Challenge - 5 Problems
Master of Testing Model Outputs
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2:00remaining
Output of a simple aggregation test in dbt
Given a dbt model that calculates total sales per region, what will be the output of this test query?
dbt
select region, sum(sales) as total_sales from sales_data group by region order by region;
Attempts:
2 left
💡 Hint
Sum sales grouped by region and order by region alphabetically.
✗ Incorrect
The query sums sales for each region and orders results alphabetically by region. The correct totals are 1500 for East and 2000 for West.
❓ data_output
intermediate1:30remaining
Result of a null value test in a dbt model
What will be the output of this test that checks for null values in the 'customer_id' column?
dbt
select count(*) as null_count from customers where customer_id is null;
Attempts:
2 left
💡 Hint
Count rows where customer_id is null.
✗ Incorrect
The query counts how many rows have null customer_id. The correct count is zero, meaning no nulls.
🔧 Debug
advanced2:00remaining
Identify the error in this dbt test SQL
What error will this dbt test SQL raise when run?
dbt
select customer_id, count(*) from orders group by customer_id having count(*) >;Attempts:
2 left
💡 Hint
Check the HAVING clause syntax.
✗ Incorrect
The HAVING clause is incomplete and missing a value after the > operator, causing a syntax error.
🚀 Application
advanced2:30remaining
Interpreting test results for data freshness in dbt
A dbt test checks if the 'last_updated' timestamp in a model is within the last 24 hours. The test returns 3 rows. What does this mean?
Attempts:
2 left
💡 Hint
Tests usually return rows that fail the condition.
✗ Incorrect
The test returns rows that violate the freshness condition, so 3 rows are stale.
🧠 Conceptual
expert2:00remaining
Understanding the impact of test failures on dbt runs
If a dbt test on a model fails during a run, what is the default behavior of dbt regarding the run status?
Attempts:
2 left
💡 Hint
Tests are separate from model builds in dbt.
✗ Incorrect
By default, dbt runs models and tests separately; test failures do not stop the run but are reported.