0
0
dbtdata~10 mins

Why dbt transformed data transformation workflows - Test Your Understanding

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

Complete the code to select all columns from the transformed table.

dbt
SELECT * FROM [1];
Drag options to blanks, or click blank then click option'
Araw_data
Btransformed_data
Cstaging_table
Danalytics
Attempts:
3 left
💡 Hint
Common Mistakes
Selecting from raw_data instead of transformed_data
Using staging_table which is intermediate
Choosing analytics which is usually for reporting
2fill in blank
medium

Complete the code to create a new table with dbt using a SELECT statement.

dbt
CREATE TABLE [1] AS SELECT * FROM source_data;
Drag options to blanks, or click blank then click option'
Atransformed_data
Braw_data
Canalytics
Dtemp_table
Attempts:
3 left
💡 Hint
Common Mistakes
Creating raw_data which is usually the input
Using analytics which is for reporting
Choosing temp_table which is temporary
3fill in blank
hard

Fix the error in the dbt model SQL by completing the WHERE clause to filter active users.

dbt
SELECT * FROM users WHERE status = [1];
Drag options to blanks, or click blank then click option'
A"active"
Bactive
C'active'
D1
Attempts:
3 left
💡 Hint
Common Mistakes
Using unquoted active causing syntax error
Using double quotes which may not work in all SQL dialects
Using 1 which is a number, not a string
4fill in blank
hard

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

dbt
{table: [1] for table, [2] in table_counts.items() if [1] > 1000}
Drag options to blanks, or click blank then click option'
Acount
Brows
Dnum_rows
Attempts:
3 left
💡 Hint
Common Mistakes
Using the same variable name for both blanks
Using variables not defined in the loop
Not matching variable names in the condition
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that maps uppercase table names to their row counts, filtering counts greater than 500.

dbt
{ [1]: [2] for [3], count in table_counts.items() if count > 500 }
Drag options to blanks, or click blank then click option'
Atable.upper()
Bcount
Ctable
Dtable.lower()
Attempts:
3 left
💡 Hint
Common Mistakes
Using lowercase instead of uppercase for keys
Mixing variable names in the loop
Using count as key instead of value