0
0
dbtdata~10 mins

One model per source table rule in dbt - Interactive Code Practice

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

Complete the code to select all columns from the source table in a dbt model.

dbt
select * from [1]
Drag options to blanks, or click blank then click option'
Aref('source_table')
Btable('my_table')
Cmodel('source_table')
Dsource('my_source', 'my_table')
Attempts:
3 left
💡 Hint
Common Mistakes
Using ref() instead of source() for source tables.
Using table() which is not a dbt function.
Using model() which is not a dbt function.
2fill in blank
medium

Complete the code to create a dbt model that selects only active users from the source table.

dbt
select * from [1] where status = 'active'
Drag options to blanks, or click blank then click option'
Asource('app', 'users')
Bref('users')
Ctable('users')
Dmodel('users')
Attempts:
3 left
💡 Hint
Common Mistakes
Using ref() which is for models, not sources.
Using table() or model() which are not valid dbt functions.
3fill in blank
hard

Fix the error in the dbt model code to correctly reference the source table.

dbt
select id, name from [1] where active = true
Drag options to blanks, or click blank then click option'
Atable('customers')
Bref('customers')
Csource('sales', 'customers')
Dmodel('customers')
Attempts:
3 left
💡 Hint
Common Mistakes
Using ref() which is for models.
Using table() or model() which are not dbt functions.
4fill in blank
hard

Fill both blanks to create a dbt model that selects user id and email from the source table where email is not null.

dbt
select [1], [2] from source('app', 'users') where email is not null
Drag options to blanks, or click blank then click option'
Aid
Bemail
Cname
Dstatus
Attempts:
3 left
💡 Hint
Common Mistakes
Selecting columns not present in the source table.
Using columns unrelated to the filter condition.
5fill in blank
hard

Fill all three blanks to create a dbt model that selects product id, name, and price from the source table where price is greater than 100.

dbt
select [1], [2], [3] from source('inventory', 'products') where price > 100
Drag options to blanks, or click blank then click option'
Aproduct_id
Bname
Cprice
Dcategory
Attempts:
3 left
💡 Hint
Common Mistakes
Selecting columns not related to the price filter.
Including columns like category which are not needed here.