0
0
dbtdata~30 mins

Model naming conventions in dbt - Mini Project: Build & Apply

Choose your learning style9 modes available
Model Naming Conventions in dbt
📖 Scenario: You are working on a data project using dbt (data build tool). To keep your project organized and easy to understand, you need to follow clear naming rules for your models. This helps your team quickly find and use the right data tables.
🎯 Goal: Learn how to create dbt models with proper names following common naming conventions. You will create model files with specific names and write simple SQL inside them.
📋 What You'll Learn
Create dbt model files with correct names
Write simple SQL SELECT statements inside models
Understand the difference between staging and final models by naming
Use lowercase letters and underscores in model names
💡 Why This Matters
🌍 Real World
In real data projects, following naming conventions helps teams understand the role of each model quickly and avoid confusion.
💼 Career
Data analysts and engineers use dbt model naming conventions to build maintainable and scalable data pipelines.
Progress0 / 4 steps
1
Create a staging model file
Create a dbt model file named stg_customers.sql with a simple SQL query that selects all columns from the raw_customers table.
dbt
Need a hint?

Use select * from raw_customers inside the stg_customers.sql file.

2
Create a final model file
Create a dbt model file named customers.sql that selects all columns from the staging model stg_customers.
dbt
Need a hint?

Use the {{ ref('stg_customers') }} function to refer to the staging model inside customers.sql.

3
Add a configuration for materialization
In the customers.sql model file, add a config block at the top to set the materialization to table.
dbt
Need a hint?

Use {{ config(materialized='table') }} at the top of the model file.

4
Print the final model name and materialization
Print the final model name customers and its materialization table as a Python dictionary.
dbt
Need a hint?

Use print({'model_name': 'customers', 'materialization': 'table'}) to show the info.