Bird
Raised Fist0
dbtdata~20 mins

Naming conventions at scale in dbt - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
Naming Conventions Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
Why use consistent naming conventions in dbt projects?

In dbt projects, why is it important to use consistent naming conventions for models, sources, and tests?

AIt prevents dbt from running models in parallel, ensuring sequential execution.
BIt allows dbt to automatically generate documentation without any manual input.
CIt helps in organizing the project and makes it easier to understand and maintain over time.
DIt reduces the size of the compiled SQL files, improving performance.
Attempts:
2 left
💡 Hint

Think about how naming helps humans and teams working together.

❓ data_output
intermediate
1:00remaining
Identify the correct model name from naming conventions

Given the naming convention stg_ prefix for staging models and int_ for intermediate models, which of the following is a correctly named intermediate model?

Astg_customer_orders
Braw_customer_orders
Ccustomer_orders_stg
Dint_customer_orders
Attempts:
2 left
💡 Hint

Look for the prefix that matches intermediate models.

❓ Predict Output
advanced
1:30remaining
Output of dbt model naming with variables

Consider this dbt model naming snippet using Jinja variables:

{% set prefix = 'stg' %}
select * from {{ prefix }}_sales_data

What is the resulting table name when compiled?

Astg_sales_data
B{{ prefix }}_sales_data
Csales_data
Dstg_sales_data_data
Attempts:
2 left
💡 Hint

Jinja variables are replaced during compilation.

🔧 Debug
advanced
1:30remaining
Identify the naming error causing dbt model failure

Which of the following model names will cause a dbt compilation error due to invalid naming conventions?

Aint_customer_data
Bcustomer-data
Cstg_customer_data
Draw_customer_data
Attempts:
2 left
💡 Hint

Check for characters not allowed in dbt model names.

🚀 Application
expert
2:00remaining
Determine the number of models following naming conventions

You have a dbt project with the following models:

  • stg_orders
  • int_orders_summary
  • raw_orders
  • orders_final
  • stg_customers
  • int_customers_summary

According to the naming convention where stg_ is staging, int_ is intermediate, and raw_ is raw data, how many models follow the naming convention correctly?

A5
B4
C3
D6
Attempts:
2 left
💡 Hint

Count models with correct prefixes only.

Practice

(1/5)
1. Why is it important to use consistent prefixes like stg_, int_, and fct_ in dbt projects?
easy
A. They make the SQL code run faster.
B. They help organize models by their role, making the project easier to understand.
C. They automatically create indexes in the database.
D. They allow dbt to skip testing models.

Solution

  1. Step 1: Understand the purpose of prefixes in dbt

    Prefixes like stg_ (staging), int_ (intermediate), and fct_ (fact) indicate the role of each model.
  2. Step 2: Recognize how prefixes help in large projects

    Using these prefixes organizes models logically, making it easier to find and maintain them.
  3. Final Answer:

    They help organize models by their role, making the project easier to understand. -> Option B
  4. Quick Check:

    Consistent prefixes = better organization [OK]
Hint: Remember: prefixes show model roles clearly [OK]
Common Mistakes:
  • Thinking prefixes affect performance
  • Assuming prefixes create database indexes
  • Believing prefixes skip tests
2. Which of the following is the correct way to name a staging model for customer data in dbt?
easy
A. stgCustomerData
B. StgCustomerData
C. STG_CUSTOMER_DATA
D. stg_customer_data

Solution

  1. Step 1: Recall dbt naming style guidelines

    dbt recommends lowercase letters and underscores to separate words for readability.
  2. Step 2: Evaluate each option

    stg_customer_data uses lowercase and underscores, matching the recommended style.
  3. Final Answer:

    stg_customer_data -> Option D
  4. Quick Check:

    Lowercase + underscores = correct naming [OK]
Hint: Use lowercase and underscores for dbt model names [OK]
Common Mistakes:
  • Using uppercase letters
  • Using camelCase instead of underscores
  • Starting with uppercase letters
3. Given the following dbt model names, which one is a fact table according to naming conventions?
stg_orders
int_customer_info
fct_sales_summary
stg_products
medium
A. stg_orders
B. int_customer_info
C. fct_sales_summary
D. stg_products

Solution

  1. Step 1: Identify prefixes and their meanings

    stg_ means staging, int_ means intermediate, fct_ means fact table.
  2. Step 2: Match the prefix to the fact table

    Only fct_sales_summary starts with fct_, indicating a fact table.
  3. Final Answer:

    fct_sales_summary -> Option C
  4. Quick Check:

    Prefix fct_ = fact table [OK]
Hint: Fact tables start with fct_ prefix [OK]
Common Mistakes:
  • Confusing staging and fact prefixes
  • Ignoring prefix meanings
  • Choosing intermediate models as fact tables
4. You see a dbt model named fct_customer_orders but it contains only raw data loading logic without aggregations. What is the likely issue?
medium
A. The model name prefix fct_ is incorrect for raw data; it should be stg_.
B. The model should be renamed to int_customer_orders because it is intermediate.
C. The model name is fine; raw data can be in fact tables.
D. The model should be deleted because it is redundant.

Solution

  1. Step 1: Understand prefix meanings

    fct_ is for fact tables, which usually contain aggregated or transactional data, not raw loads.
  2. Step 2: Match model content to prefix

    Since the model only loads raw data, stg_ (staging) prefix is more appropriate.
  3. Final Answer:

    The model name prefix fct_ is incorrect for raw data; it should be stg_. -> Option A
  4. Quick Check:

    Raw data = stg_ prefix [OK]
Hint: Match prefix to model content type [OK]
Common Mistakes:
  • Assuming any prefix works for any model
  • Thinking raw data belongs in fact tables
  • Renaming without checking model logic
5. In a large dbt project, you want to create a naming convention that helps new team members quickly identify model types and their dependencies. Which approach best supports this goal?
hard
A. Use consistent prefixes like stg_, int_, fct_, keep names lowercase with underscores, and document the naming rules.
B. Use random prefixes for variety, mix uppercase and lowercase, and avoid documentation to encourage exploration.
C. Name all models with the project name prefix only, ignoring model roles and dependencies.
D. Use only numbers as prefixes to indicate model order, without descriptive names.

Solution

  1. Step 1: Identify best practices for naming at scale

    Consistent prefixes and lowercase with underscores improve clarity and readability.
  2. Step 2: Recognize importance of documentation

    Documenting naming rules helps new team members understand conventions and dependencies quickly.
  3. Final Answer:

    Use consistent prefixes like stg_, int_, fct_, keep names lowercase with underscores, and document the naming rules. -> Option A
  4. Quick Check:

    Consistency + documentation = easier onboarding [OK]
Hint: Combine clear prefixes with documentation [OK]
Common Mistakes:
  • Ignoring documentation
  • Using inconsistent naming styles
  • Choosing unclear or numeric-only prefixes
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard