0
0
dbtdata~20 mins

Why advanced patterns solve complex analytics in dbt - Challenge Your Understanding

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Advanced Analytics Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2: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
AThe count of all users who had at least one 'click' event
BThe count of all users who had at least one 'view' event
CThe count of all users who had both 'click' and 'view' events
DThe count of all events regardless of user or type
Attempts:
2 left
💡 Hint
Look at the filter in the 'filtered' CTE and what distinct does.
data_output
intermediate
2: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 customers
AOnly the latest row per customer_id with the current email
BA single row per customer_id with the first email ever recorded
CMultiple rows per customer_id showing each email change over time
DRows only for customers whose email never changed
Attempts:
2 left
💡 Hint
Snapshots keep history of changes based on the strategy.
visualization
advanced
2: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?
AScatter plot of user age vs. activity count
BBar chart showing total sign-ups per month
CPie chart showing percentage of users by country
DLine chart showing count of active users by week since sign-up
Attempts:
2 left
💡 Hint
Retention is about tracking users over time since an event.
🧠 Conceptual
advanced
2: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?
AThey update only new or changed data, reducing processing time
BThey create full copies of data every run for backup
CThey automatically optimize SQL queries for speed
DThey allow running models without any dependencies
Attempts:
2 left
💡 Hint
Think about how to avoid reprocessing all data every time.
🔧 Debug
expert
2: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_id
ASyntax error near 'left join'
BColumn 'a.id' does not exist
CAmbiguous column name 'user_id'
DNo error, query runs successfully
Attempts:
2 left
💡 Hint
Check if the column names in join condition match the table aliases.