Style for dbts
dbt style is the convention for organising models into layers so a project stays readable as it grows. Staging models clean and rename one source each, intermediate models combine logic, and mart models expose business entities. Consistent naming, folder structure and CTE patterns make reviews and onboarding easier.
Stage: Foundations · Part of the dbt roadmap · Last reviewed 19 November 2026
What to learn in Style
- Create one staging model per source table with renamed and typed columns
- Place joins and business logic in intermediate models, not in staging
- Name models with prefixes like stg_, int_ and fct_ or dim_
- Write readable SQL using import CTEs and a final select
- Keep marts focused on business concepts such as orders or customers
Style interview questions
Why have a staging layer in a dbt project?
Staging models are the single place where raw source columns are renamed, cast and lightly cleaned. Downstream models then rely on consistent names and types, and a source change needs fixing in one model instead of many.
What belongs in an intermediate model?
Intermediate models hold reusable transformation steps that are not final outputs, such as joining orders to payments or pivoting events. They keep marts simple, avoid repeated logic and are usually not exposed to business users.
Where Style fits in the dbt roadmap
Style belongs to the Foundations stage (beginner level), which takes about 15 hours. A dbt project.