Jump into concepts and practice - no test required
or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Recall & Review
beginner
What is the main purpose of using model naming conventions in dbt?
Model naming conventions help keep your project organized, make models easy to find, and improve collaboration by using clear and consistent names.
Click to reveal answer
beginner
In dbt, what does a model name usually represent?
A model name usually represents a single table or view in your data warehouse, often describing the data it contains or the transformation it performs.
Click to reveal answer
beginner
Why should you avoid using spaces or special characters in dbt model names?
Spaces and special characters can cause errors or confusion in SQL queries and file systems, so using underscores or lowercase letters keeps names safe and consistent.
Click to reveal answer
intermediate
What is a common pattern for naming dbt models that represent raw data sources?
A common pattern is to prefix raw data source models with 'stg_' (short for staging), like 'stg_customers', to show they are initial cleaned versions of source data.
Click to reveal answer
intermediate
How can consistent model naming conventions improve teamwork in dbt projects?
Consistent names make it easier for team members to understand what each model does, find models quickly, and avoid mistakes when writing or reviewing code.
Click to reveal answer
Which of the following is a good dbt model name for a cleaned customer data table?
Aclean customers
BClean Customers
Cclean-customers
Dclean_customers
✗ Incorrect
Model names should use underscores and lowercase letters without spaces or special characters.
What prefix is commonly used for staging models in dbt?
Astg_
Braw_
Cint_
Dfinal_
✗ Incorrect
The prefix 'stg_' is commonly used to indicate staging models that clean raw data.
Why is it important to have consistent naming conventions in dbt models?
ATo improve organization and collaboration
BTo confuse team members
CTo make models harder to find
DTo increase file size
✗ Incorrect
Consistent naming helps organize models and makes teamwork easier.
Which character is recommended to separate words in dbt model names?
ASpace
B-
C_
D.
✗ Incorrect
Underscores (_) are recommended to separate words in model names.
What does a dbt model name usually describe?
AThe color of the data
BThe data or transformation it contains
CThe size of the database
DThe user who created it
✗ Incorrect
Model names describe the data or transformation they represent.
Explain why using consistent model naming conventions is important in dbt projects.
Think about how clear names help you and your team work better.
You got /4 concepts.
Describe a good naming pattern for staging models in dbt and why it helps.
Focus on how naming shows the model's role.
You got /4 concepts.
Practice
(1/5)
1. Which of the following is the best practice for naming a dbt model?
easy
A. Use clear, lowercase names with underscores to separate words
B. Use uppercase letters and spaces between words
C. Use special characters like # or $ in the name
D. Use very long names without any separators
Solution
Step 1: Understand dbt naming conventions
dbt recommends using clear, lowercase names with underscores to separate words for readability and consistency.
Step 2: Evaluate each option
Use clear, lowercase names with underscores to separate words follows the recommended style. Options A, B, and D do not follow best practices.
Final Answer:
Use clear, lowercase names with underscores to separate words -> Option A
Quick Check:
Clear lowercase with underscores = C [OK]
Hint: Choose lowercase with underscores for clarity [OK]
Common Mistakes:
Using uppercase letters in model names
Including spaces or special characters
Using inconsistent naming styles
2. Which of these is a valid dbt model name?
easy
A. customer_orders
B. SalesReport2023
C. Inventory-List
D. Profit$Summary
Solution
Step 1: Check naming rules for dbt models
Model names should be lowercase and use underscores to separate words, avoiding special characters and uppercase letters.
Step 2: Analyze each option
customer_orders uses lowercase letters and underscores only, making it valid. Options B, C, and D contain uppercase letters or special characters.
Final Answer:
customer_orders -> Option A
Quick Check:
Lowercase with underscores = A [OK]
Hint: Pick lowercase with underscores, no special chars [OK]
Common Mistakes:
Using uppercase letters in model names
Including hyphens or special characters
Starting names with numbers
3. Given the following dbt model names, which one best describes a model that summarizes monthly sales data? monthly_sales_summary salesMonthlySummary monthly-sales-summary MonthlySalesSummary
medium
A. MonthlySalesSummary
B. salesMonthlySummary
C. monthly-sales-summary
D. monthly_sales_summary
Solution
Step 1: Identify the best naming style for dbt models
dbt prefers lowercase names with underscores to separate words for clarity and consistency.
Step 2: Compare each model name
monthly_sales_summary uses lowercase with underscores and clearly describes the model. Options A and B use camel case or uppercase letters, and C uses hyphens, which are not recommended.
Final Answer:
monthly_sales_summary -> Option D
Quick Check:
Lowercase with underscores = D [OK]
Hint: Look for lowercase with underscores describing content [OK]
Common Mistakes:
Using camelCase or PascalCase
Using hyphens instead of underscores
Ignoring clarity in names
4. You have a dbt model named CustomerOrders. What is the issue with this name and how can you fix it?
medium
A. It uses underscores incorrectly; rename to customerorders
B. It uses uppercase letters; rename to customer_orders
C. It is too short; rename to customer_orders_summary
D. It uses special characters; rename to customer-orders
Solution
Step 1: Identify naming convention violation
The model name uses uppercase letters, which is against dbt's lowercase naming convention.
Step 2: Apply correct naming style
Rename the model to lowercase letters with underscores: customer_orders.
Final Answer:
It uses uppercase letters; rename to customer_orders -> Option B
Quick Check:
Uppercase letters not allowed = A [OK]
Hint: Rename uppercase to lowercase with underscores [OK]
Common Mistakes:
Ignoring uppercase letters in names
Removing underscores instead of fixing case
Adding unnecessary special characters
5. You want to create a dbt model that calculates the total revenue per product category for the last year. Which model name follows best practices and clearly describes the model's purpose?
hard
A. totalRevenuePerCategoryLastYear
B. Total_Revenue_Per_Category_Last_Year
C. total_revenue_per_category_last_year
D. revenue-category-last-year
Solution
Step 1: Understand naming best practices
dbt model names should be lowercase, use underscores, and clearly describe the model's content.
Step 2: Evaluate each option
total_revenue_per_category_last_year uses lowercase letters and underscores, and clearly describes the model. Options A and C use uppercase or camel case, and D uses hyphens.
Final Answer:
total_revenue_per_category_last_year -> Option C
Quick Check:
Lowercase with underscores and clear description = B [OK]
Hint: Use lowercase with underscores and descriptive words [OK]