0
0
dbtdata~10 mins

Cross-team model sharing 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 reference a model from another team in dbt.

dbt
select * from [1]
Drag options to blanks, or click blank then click option'
Aref('marketing.campaigns')
Bref('sales.orders')
Cref('finance.budget')
Dref('hr.employees')
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong team name in ref()
Forgetting to use ref() function
Using quotes incorrectly
2fill in blank
medium

Complete the code to create a model that selects data from a shared model in another team.

dbt
select user_id, purchase_amount from [1] where purchase_date > '2024-01-01'
Drag options to blanks, or click blank then click option'
Aref('marketing.campaigns')
Bref('sales.orders')
Cref('finance.transactions')
Dref('support.tickets')
Attempts:
3 left
💡 Hint
Common Mistakes
Referencing the wrong team's model
Not using ref() function
Syntax errors in the select statement
3fill in blank
hard

Fix the error in the code to correctly reference a model from another team.

dbt
select * from [1]
Drag options to blanks, or click blank then click option'
Aref('marketing.campaigns')
Bref('marketing_campaigns')
Cref("marketing.campaigns")
Dref(marketing.campaigns)
Attempts:
3 left
💡 Hint
Common Mistakes
Missing quotes around model name
Using incorrect quotes or underscores
Passing variable instead of string
4fill in blank
hard

Fill both blanks to create a model that filters data from a shared model and orders results.

dbt
select * from [1] where status = 'active' order by [2] desc
Drag options to blanks, or click blank then click option'
Aref('sales.customers')
Bref('marketing.leads')
Ccreated_at
Dcustomer_id
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong model reference
Ordering by a non-date column
Syntax errors in order by clause
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that maps model names to their row counts for shared models.

dbt
model_counts = { [1]: [2] for [3] in shared_models }
Drag options to blanks, or click blank then click option'
Amodel
Bget_row_count(model)
D{
Attempts:
3 left
💡 Hint
Common Mistakes
Missing curly braces for dictionary
Incorrect variable names in comprehension
Not calling the row count function properly