0
0
dbtdata~10 mins

Why project structure scales with team size in dbt - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to define a dbt model that selects all columns from the source table.

dbt
select * from [1]
Drag options to blanks, or click blank then click option'
Atable('raw_data')
Bsource('raw', 'table')
Cref('source_table')
Ddataset('source')
Attempts:
3 left
💡 Hint
Common Mistakes
Using ref() instead of source() for raw tables.
Using incorrect function names like table() or dataset().
2fill in blank
medium

Complete the code to create a model that references another model named 'customers'.

dbt
select * from [1]
Drag options to blanks, or click blank then click option'
Aref('customers')
Bsource('raw', 'customers')
Ctable('customers')
Ddataset('customers')
Attempts:
3 left
💡 Hint
Common Mistakes
Using source() instead of ref() for models.
Using non-dbt functions like table().
3fill in blank
hard

Fix the error in the dbt model code to correctly filter customers with more than 5 orders.

dbt
select customer_id, count(order_id) as order_count
from [1]
group by customer_id
having order_count > 5
Drag options to blanks, or click blank then click option'
Adataset('orders')
Bsource('raw', 'orders')
Ctable('orders')
Dref('orders')
Attempts:
3 left
💡 Hint
Common Mistakes
Using source() for models instead of ref().
Using non-dbt functions like table().
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that maps model names to their descriptions if the description exists.

dbt
model_descriptions = {model: [1] for model, [2] in models.items() if description}
Drag options to blanks, or click blank then click option'
Adescription
Bdesc
Attempts:
3 left
💡 Hint
Common Mistakes
Using the same variable name for both key and value.
Using undefined variable names.
5fill in blank
hard

Fill all three blanks to create a filtered dictionary of models with more than 100 rows.

dbt
large_models = { [1]: [2] for [3], [2] in models.items() if [2]['row_count'] > 100 }
Drag options to blanks, or click blank then click option'
Amodel_name
Bmodel_info
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up key and value variable names.
Using inconsistent variable names in the loop.