0
0
dbtdata~20 mins

Why models are the core of dbt - Challenge Your Understanding

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
dbt Model Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Why are models central in dbt?

In dbt, models are the main building blocks. Which statement best explains why models are the core of dbt?

AModels define SQL queries that transform raw data into clean, usable tables or views.
BModels are used only to schedule dbt runs automatically.
CModels store the raw data before any transformation.
DModels are scripts that install dbt on your computer.
Attempts:
2 left
💡 Hint

Think about what dbt does with data and how models fit in.

Predict Output
intermediate
2:00remaining
Output of a simple dbt model SQL

Given this dbt model SQL code, what will be the output table content?

dbt
select id, upper(name) as name_upper from raw.customers where active = true
A[{'id': 1, 'name_upper': 'ALICE'}, {'id': 3, 'name_upper': 'CHARLIE'}]
B[{'id': 1, 'name_upper': 'alice'}, {'id': 3, 'name_upper': 'charlie'}]
C[{'id': 2, 'name_upper': 'BOB'}, {'id': 4, 'name_upper': 'DAVID'}]
DSyntaxError: missing FROM clause
Attempts:
2 left
💡 Hint

Look at the filter and the upper function.

data_output
advanced
1:30remaining
Number of models created after running dbt

If you have 5 SQL files in your models folder and run dbt run, how many models will be created in your data warehouse?

ADepends on the number of sources
B0
C1
D5
Attempts:
2 left
💡 Hint

Each SQL file in the models folder corresponds to one model.

🔧 Debug
advanced
2:00remaining
Identify the error in this dbt model SQL

What error will this dbt model SQL produce when run?

dbt
select id, name from raw.customers where active = 'yes'
ANo error, runs successfully
BRuntime error: invalid boolean comparison
CSyntaxError: missing comma
DKeyError: 'active' column not found
Attempts:
2 left
💡 Hint

Check the data type of the 'active' column and the filter value.

🚀 Application
expert
2:30remaining
Choosing the right model materialization

You want your dbt model to update quickly and reflect the latest data without rebuilding the entire table. Which materialization should you choose?

ATable materialization
BView materialization
CIncremental materialization
DEphemeral materialization
Attempts:
2 left
💡 Hint

Think about materializations that update only new or changed data.