dbt Cheat Sheet
Models, tests, incremental tables, snapshots, and environments — the dbt patterns from the track on one page. Bookmark it.
Projects to build
The fastest way to make this stick. Build one, then put it in your portfolio.
Staging orders
Declare an app.orders source, build stg_orders with source(), and add unique and not_null tests on order_id. Run dbt build and fix one failing row.
Documented orders mart
Add fct_orders on top of staging with ref(), column descriptions, and a doc block for amount. Generate the docs site and check the DAG runs source, then staging, then the mart.
Incremental orders
Change fct_orders to an incremental merge on order_id and filter with is_incremental(). Rehearse a --full-refresh and say which rows a normal rerun will touch.
Customer history
Snapshot customers with a timestamp strategy so email changes keep history, and load a country CSV as a seed. Join both from a mart and select the current row where dbt_valid_to is null.
Layered prod project
Split staging, intermediate, and marts, install dbt_utils, and point dev and prod at different databases with env_var. Run a slim CI build that selects state:modified+ and defers to prod artifacts.
