0
0
dbtdata~10 mins

Naming conventions at scale in dbt - Interactive Code Practice

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

Complete the code to define a model with a proper naming convention prefix.

dbt
models:
  - name: [1]_sales_data
    description: "Model for sales data"
Drag options to blanks, or click blank then click option'
Astg
Btmp
Cint
Draw
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'raw' prefix for transformed data
Using 'tmp' which is usually for temporary or intermediate models
2fill in blank
medium

Complete the code to set a naming convention for incremental models.

dbt
models:
  - name: [1]_customer_updates
    config:
      materialized: incremental
Drag options to blanks, or click blank then click option'
Atmp
Braw
Cstg
Dint
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'raw' prefix for incremental models
Using 'stg' which is for staging models
3fill in blank
hard

Fix the error in the naming convention for a temporary model.

dbt
models:
  - name: [1]_temp_results
    config:
      materialized: table
Drag options to blanks, or click blank then click option'
Astg
Btmp
Cint
Draw
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'raw' or 'stg' prefixes for temporary models
Not matching the prefix with the materialization type
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that maps model names to their prefixes based on naming conventions.

dbt
model_prefixes = {model: [1] for model in models if model.startswith([2])}
Drag options to blanks, or click blank then click option'
Amodel.split('_')[0]
B'stg_'
C'int_'
Dmodel.upper()
Attempts:
3 left
💡 Hint
Common Mistakes
Using uppercase conversion instead of splitting
Filtering with wrong prefix string
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that maps model names to their suffixes if they end with '_data' and have a 'raw' prefix.

dbt
filtered_models = {model: model[1] for model in models if model.startswith([2]) and model.endswith([3])}
Drag options to blanks, or click blank then click option'
A[4:]
B'raw_'
C'_data'
D[:4]
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect slice indices
Using wrong prefix or suffix strings