Bird
0
0

According to the one model per source table rule, how should you organize your dbt models if you want to create a report showing total orders per customer?

hard📝 Application Q15 of 15
dbt - Project Organization
You have two source tables: customers and orders. According to the one model per source table rule, how should you organize your dbt models if you want to create a report showing total orders per customer?
ACreate separate base models for <code>customers</code> and <code>orders</code>, then create a third model joining them for the report
BCreate one model combining both source tables directly without base models
CCreate a single model selecting from both source tables with UNION
DCreate only one model for <code>orders</code> and ignore <code>customers</code>
Step-by-Step Solution
Solution:
  1. Step 1: Follow one model per source table for base models and build report model

    Create one model for customers and one for orders separately to keep base models simple. Create a third model that joins these base models to calculate total orders per customer, keeping transformations clear and modular.
  2. Final Answer:

    Create separate base models for customers and orders, then create a third model joining them for the report -> Option A
  3. Quick Check:

    Base models per source + separate report model [OK]
Quick Trick: Base models per source, then join in separate model [OK]
Common Mistakes:
MISTAKES
  • Combining sources in one base model
  • Skipping base models and joining sources directly
  • Ignoring one source table

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More dbt Quizzes