0
0
dbtdata~10 mins

Creating your first model in dbt - Interactive Practice

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

Complete the code to create a simple dbt model selecting all columns from the source table.

dbt
select * from [1]
Drag options to blanks, or click blank then click option'
Aref_table
Bmy_table
Cdbt_model
Dsource_table
Attempts:
3 left
💡 Hint
Common Mistakes
Using a table name that does not exist in the project.
Forgetting to use the correct table name.
2fill in blank
medium

Complete the code to reference another model named 'customers' in your dbt model.

dbt
select * from [1]('customers')
Drag options to blanks, or click blank then click option'
Asource
Btable
Cref
Dmodel
Attempts:
3 left
💡 Hint
Common Mistakes
Using source instead of ref to reference models.
Forgetting the parentheses after the function name.
3fill in blank
hard

Fix the error in the model code to correctly filter rows where 'status' is 'active'.

dbt
select * from [1] where status = 'active'
Drag options to blanks, or click blank then click option'
Aref('orders')
Bsource('orders')
Cref('order')
Dsource('order')
Attempts:
3 left
💡 Hint
Common Mistakes
Using source instead of ref for models.
Misspelling the model name.
4fill in blank
hard

Fill both blanks to create a model that selects 'id' and 'name' columns from the 'users' model.

dbt
select [1], [2] from [3]('users')
Drag options to blanks, or click blank then click option'
Aid
Bref
Cname
Dsource
Attempts:
3 left
💡 Hint
Common Mistakes
Using source instead of ref.
Selecting columns not present in the 'users' model.
5fill in blank
hard

Fill all three blanks to create a model that counts orders with status 'completed' from the 'orders' model.

dbt
select count([1]) as completed_orders from [2]('orders') where [3] = 'completed'
Drag options to blanks, or click blank then click option'
A*
Bref
Cstatus
Did
Attempts:
3 left
💡 Hint
Common Mistakes
Using '*' inside count() which counts all rows but may be less precise.
Using source instead of ref.
Filtering on a wrong column name.