Challenge - 5 Problems
Advanced Analytics Mastery
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 count of unique users in the final output?
dbt
with base as ( select user_id, event_type from events where event_type in ('click', 'view') ), filtered as ( select distinct user_id from base where event_type = 'click' ) select count(*) as unique_click_users from filtered
Attempts:
2 left
💡 Hint
Look at the filter in the 'filtered' CTE and what distinct does.
✗ Incorrect
The 'filtered' CTE selects distinct user_ids where event_type is 'click'. The final count counts these unique users who clicked.
❓ data_output
intermediate2:00remaining
What does this dbt snapshot produce?
Consider a dbt snapshot that tracks changes in a 'customers' table. If a customer's email changes, what will the snapshot table contain?
dbt
snapshot customers_snapshot {
strategy = 'timestamp'
updated_at = 'last_updated'
unique_key = 'customer_id'
}
select * from customersAttempts:
2 left
💡 Hint
Snapshots keep history of changes based on the strategy.
✗ Incorrect
The timestamp strategy tracks changes by updated_at column, so each email change creates a new row with a new timestamp.
❓ visualization
advanced2:00remaining
Which visualization best shows user retention over time?
You have a table with user sign-up dates and their activity dates. Which chart type best shows how many users remain active each week after sign-up?
Attempts:
2 left
💡 Hint
Retention is about tracking users over time since an event.
✗ Incorrect
A line chart showing active users by week since sign-up clearly shows retention trends.
🧠 Conceptual
advanced2:00remaining
Why use incremental models in dbt for large datasets?
What is the main advantage of using incremental models in dbt when working with large data?
Attempts:
2 left
💡 Hint
Think about how to avoid reprocessing all data every time.
✗ Incorrect
Incremental models process only new or changed rows, saving time and resources on large datasets.
🔧 Debug
expert2:00remaining
What error does this dbt model produce?
This dbt model SQL is intended to join two tables but fails. What error will it raise?
dbt
select a.user_id, b.order_id
from users a
left join orders b
on a.user_id = b.user_idAttempts:
2 left
💡 Hint
Check if the column names in join condition match the table aliases.
✗ Incorrect
The users table alias 'a' does not have a column named 'id', causing a column not found error.