Staging, Intermediate, and Marts Pattern in dbt
📖 Scenario: You work as a data analyst at a retail company. You receive raw sales data from multiple sources. To make this data useful for business decisions, you need to organize it in layers: staging, intermediate, and marts.Staging cleans and standardizes raw data. Intermediate transforms and combines staging data. Marts prepare final tables for reporting.
🎯 Goal: Build a simple dbt project with three models: a staging model to clean raw sales data, an intermediate model to calculate monthly sales totals, and a marts model to prepare the final sales report.
📋 What You'll Learn
Create a staging model called
stg_sales that selects and cleans raw sales dataCreate an intermediate model called
int_monthly_sales that aggregates sales by monthCreate a marts model called
mart_sales_report that selects final columns for reportingUse dbt model files with correct SQL SELECT statements
Use appropriate naming conventions for each layer
💡 Why This Matters
🌍 Real World
Data teams use this pattern to build reliable, maintainable data pipelines that transform raw data into business-ready reports.
💼 Career
Understanding this pattern is essential for data analysts, engineers, and scientists working with dbt or modern data warehouses.
Progress0 / 4 steps