0
0
dbtdata~10 mins

Why packages accelerate dbt development - Test Your Understanding

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

Complete the code to import a dbt package in your project.

dbt
packages:
  - package: [1]
Drag options to blanks, or click blank then click option'
Apandas
Bdbt_utils
Cnumpy
Dmatplotlib
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing packages unrelated to dbt like pandas or numpy.
Forgetting to add the package under the packages section.
2fill in blank
medium

Complete the code to use a macro from a dbt package in a model.

dbt
select * from [1].get_relations_by_prefix('my_schema', 'my_prefix')
Drag options to blanks, or click blank then click option'
Amatplotlib
Bpandas
Cnumpy
Ddbt_utils
Attempts:
3 left
💡 Hint
Common Mistakes
Using Python package names instead of dbt package names.
Not referencing the package name before the macro.
3fill in blank
hard

Fix the error in the dbt model code by completing the blank.

dbt
select
  [1]('column_name') as column_length
from my_table
Drag options to blanks, or click blank then click option'
Alength
Blen
Ccount
Dsum
Attempts:
3 left
💡 Hint
Common Mistakes
Using Python's len() instead of SQL's length().
Using aggregate functions like count or sum incorrectly.
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that filters words longer than 3 characters.

dbt
{word: [1] for word in words if len(word) [2] 3}
Drag options to blanks, or click blank then click option'
Alen(word)
B>
C<
Dword
Attempts:
3 left
💡 Hint
Common Mistakes
Using the word itself as the value instead of its length.
Using less than < instead of greater than >.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that maps uppercase keys to values greater than zero.

dbt
result = [1]: [2] for k, v in data.items() if v [3] 0}
Drag options to blanks, or click blank then click option'
Ak.upper()
Bv
C>
Dk.lower()
Attempts:
3 left
💡 Hint
Common Mistakes
Using lowercase keys instead of uppercase.
Using wrong comparison operators like < or ==.