Bird
0
0

Which of the following is the correct way to use is_incremental() in a dbt model SQL file?

easy📝 Syntax Q12 of 15
dbt - Incremental Models
Which of the following is the correct way to use is_incremental() in a dbt model SQL file?
AWHERE is_incremental = true
BSELECT * FROM table WHERE is_incremental() = true
C{% if is_incremental() %} WHERE updated_at > (SELECT MAX(updated_at) FROM {{ this }}) {% endif %}
DSELECT * FROM table WHERE incremental = is_incremental()
Step-by-Step Solution
Solution:
  1. Step 1: Recognize correct Jinja syntax for is_incremental()

    It must be used inside a Jinja if statement with {% %} tags.
  2. Step 2: Check the options for correct usage

    {% if is_incremental() %} WHERE updated_at > (SELECT MAX(updated_at) FROM {{ this }}) {% endif %} uses {% if is_incremental() %} correctly to conditionally add a WHERE clause.
  3. Final Answer:

    {% if is_incremental() %} WHERE updated_at > (SELECT MAX(updated_at) FROM {{ this }}) {% endif %} -> Option C
  4. Quick Check:

    Use Jinja {% if is_incremental() %} for conditional SQL [OK]
Quick Trick: Use {% if is_incremental() %} to add incremental filters [OK]
Common Mistakes:
MISTAKES
  • Using is_incremental() directly in SQL WHERE clause
  • Missing Jinja tags {% %}
  • Using is_incremental as a column or variable

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More dbt Quizzes