Challenge - 5 Problems
dbt Model Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2:00remaining
What is the output of this dbt model SQL?
Given the following dbt model SQL, what will be the resulting table's row count if the source table has 100 rows with 20 rows having NULL in the column
status?dbt
select * from {{ source('raw_data', 'orders') }} where status is not null
Attempts:
2 left
💡 Hint
Think about how the WHERE clause filters rows with NULL status.
✗ Incorrect
The WHERE clause excludes rows where
status is NULL, so only 80 rows remain.❓ data_output
intermediate2:00remaining
What columns will the model output have?
Consider this dbt model SQL that selects specific columns from a source table. What columns will the resulting model table contain?
dbt
select order_id, customer_id, order_date from {{ source('raw_data', 'orders') }}
Attempts:
2 left
💡 Hint
Look at the SELECT statement columns.
✗ Incorrect
The model explicitly selects only order_id, customer_id, and order_date columns.
🔧 Debug
advanced2:00remaining
Why does this dbt model fail to compile?
This dbt model SQL throws a compilation error. What is the cause?
dbt
select * from {{ source('raw_data', orders) }}
Attempts:
2 left
💡 Hint
Check the syntax of the source function arguments.
✗ Incorrect
The table name must be a string literal, so it needs quotes.
🚀 Application
advanced2:30remaining
How to create a model that aggregates total sales per customer?
You want to create a dbt model that shows total sales amount per customer from the
orders source table with columns customer_id and amount. Which SQL snippet correctly achieves this?Attempts:
2 left
💡 Hint
Remember to use GROUP BY when aggregating and alias the sum.
✗ Incorrect
Option C correctly sums amounts per customer and groups by customer_id.
🧠 Conceptual
expert2:00remaining
What is the main benefit of using dbt models for data transformation?
Choose the best explanation for why dbt models are useful in data projects.
Attempts:
2 left
💡 Hint
Think about how dbt helps organize and manage SQL code.
✗ Incorrect
dbt models let you write SQL in files that are version controlled and build a dependency graph for transformations.