0
0
dbtdata~10 mins

Why optimization reduces warehouse costs 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 select all columns from the sales table.

dbt
SELECT [1] FROM sales
Drag options to blanks, or click blank then click option'
Aall
B*
Ccolumns
Deverything
Attempts:
3 left
💡 Hint
Common Mistakes
Using words like 'all' or 'columns' instead of '*'
Leaving the SELECT statement incomplete
2fill in blank
medium

Complete the code to filter sales where amount is greater than 100.

dbt
SELECT * FROM sales WHERE amount [1] 100
Drag options to blanks, or click blank then click option'
A>
B=
C<
D<=
Attempts:
3 left
💡 Hint
Common Mistakes
Using '<' instead of '>'
Using '=' which checks for equality
3fill in blank
hard

Fix the error in the code to calculate total sales per product.

dbt
SELECT product_id, SUM([1]) FROM sales GROUP BY product_id
Drag options to blanks, or click blank then click option'
Aquantity
Bproduct_id
Ctotal
Dprice
Attempts:
3 left
💡 Hint
Common Mistakes
Summing product_id which is an identifier
Summing price instead of quantity
4fill in blank
hard

Fill both blanks to create a dictionary of product sales where sales are above 50.

dbt
sales_dict = { [1]: [2] for [1] in products if sales[[1]] > 50 }
Drag options to blanks, or click blank then click option'
Aproduct
Bsales
Cproduct_id
Dquantity
Attempts:
3 left
💡 Hint
Common Mistakes
Using quantity as key instead of product_id
Using product as key but not matching loop variable
5fill in blank
hard

Fill all three blanks to create a filtered dictionary of products with quantity above 10.

dbt
filtered = { [1]: [2] for [1] in inventory if inventory[[1]] [3] 10 }
Drag options to blanks, or click blank then click option'
Aitem
Binventory
C>
D<
Attempts:
3 left
💡 Hint
Common Mistakes
Using '<' instead of '>' in filter
Mismatching key and loop variable names