Complete the code to create a simple dbt model selecting all columns from the source table.
select * from [1]
The code selects all columns from the source table named source_table. This is the basic way to create a dbt model.
Complete the code to reference another model named 'customers' in your dbt model.
select * from [1]('customers')
source instead of ref to reference models.The ref function is used in dbt to reference other models by name, here referencing the 'customers' model.
Fix the error in the model code to correctly filter rows where 'status' is 'active'.
select * from [1] where status = 'active'
source instead of ref for models.The correct way to reference the 'orders' model is using ref('orders'). This ensures the model compiles correctly and filters active status rows.
Fill both blanks to create a model that selects 'id' and 'name' columns from the 'users' model.
select [1], [2] from [3]('users')
source instead of ref.The model selects the 'id' and 'name' columns from the 'users' model using ref('users') to reference it.
Fill all three blanks to create a model that counts orders with status 'completed' from the 'orders' model.
select count([1]) as completed_orders from [2]('orders') where [3] = 'completed'
source instead of ref.The code counts the number of 'id' entries in the 'orders' model referenced by ref('orders') where the 'status' is 'completed'.