0
0
dbtdata~10 mins

Why incremental models save time and cost in dbt - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to define an incremental model in dbt.

dbt
{{config(materialized='[1]')}}

select * from source_table
Drag options to blanks, or click blank then click option'
Aephemeral
Btable
Cview
Dincremental
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing 'table' causes full rebuilds every time.
Using 'view' does not store data physically.
Selecting 'ephemeral' runs the model inline without saving.
2fill in blank
medium

Complete the code to add a condition that processes only new rows in an incremental model.

dbt
select * from source_table where updated_at > (select max(updated_at) from {{this}}) or [1]
Drag options to blanks, or click blank then click option'
Atrue
Bfalse
C1=0
Dupdated_at < max(updated_at)
Attempts:
3 left
💡 Hint
Common Mistakes
Using '1=0' excludes all rows.
Using 'false' excludes all rows.
Using 'updated_at < max(updated_at)' is logically incorrect.
3fill in blank
hard

Fix the error in the incremental model config to enable incremental updates.

dbt
{{config(materialized='[1]', unique_key='id')}}

select * from source_table
Drag options to blanks, or click blank then click option'
Aincremental
Btable
Cview
Dephemeral
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'table' causes full rebuilds.
Using 'view' or 'ephemeral' ignores unique_key.
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that maps table names to their row counts, but only for tables with more than 1000 rows.

dbt
{table: count for table, count in table_counts.items() if count [1] 1000 and table [2] 'archive'}
Drag options to blanks, or click blank then click option'
A>
B<
C!=
D==
Attempts:
3 left
💡 Hint
Common Mistakes
Using '<' includes small tables.
Using '==' includes only 'archive' table.
Using '!=' incorrectly excludes other tables.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that maps uppercase table names to their row counts, but only for tables with counts greater than 500 and names not equal to 'temp'.

dbt
{ [1]: [2] for table, count in table_counts.items() if count [3] 500 and table != 'temp' }
Drag options to blanks, or click blank then click option'
Atable.upper()
Bcount
C>
Dtable.lower()
Attempts:
3 left
💡 Hint
Common Mistakes
Using table.lower() instead of uppercase.
Using < or == for count filter.
Swapping keys and values in the comprehension.