Bird
0
0

Given this dbt incremental model SQL snippet:

medium📝 Predict Output Q13 of 15
dbt - Incremental Models
Given this dbt incremental model SQL snippet:
SELECT
  id,
  event_date,
  data_value
FROM source_table
WHERE event_date >= (SELECT MAX(event_date) FROM {{ this }})

What is the main purpose of this WHERE clause?
ATo select only new or updated data since last run
BTo select all data including duplicates
CTo exclude all late-arriving data
DTo select data with null event_date
Step-by-Step Solution
Solution:
  1. Step 1: Analyze the WHERE clause logic

    The clause filters rows where event_date is greater or equal to the max event_date already in the target table, meaning it picks new or updated data since last run.
  2. Step 2: Understand incremental model behavior

    This is a common pattern in dbt incremental models to avoid reprocessing old data and only add new or changed rows.
  3. Final Answer:

    To select only new or updated data since last run -> Option A
  4. Quick Check:

    Incremental filter = new or updated data [OK]
Quick Trick: Incremental models filter data newer than max existing date [OK]
Common Mistakes:
MISTAKES
  • Thinking it excludes late-arriving data
  • Assuming it selects duplicates
  • Confusing null filtering with this clause

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More dbt Quizzes