๐Ÿ—๏ธ The Complete dbt Course

12 lessons from zero to production. Every concept explained like you're 5 years old, with animations, analogies, and hands-on exercises.

What You'll Master

12
Lessons
50+
Code Examples
36+
Quiz Questions
100%
Free & Open

dbt (Data Build Tool) lets you write SQL that turns raw data into clean, tested tables โ€” and it runs inside your warehouse, tracks lineage, and generates documentation automatically. Think of it as a magical robot chef that follows your SQL recipes, checks quality, and keeps a perfect cookbook.

All 12 Lessons

Module 1: Introduction

Module 2: Getting Started

Module 3: Core Concepts

Module 4: Quality & Documentation

Module 5: Power Features

Module 6: Production & Advanced

โŒจ๏ธ dbt Commands Cheat Sheet

dbt init my_project
Create a new dbt project with starter files
dbt debug
Test your warehouse connection
dbt deps
Install packages from packages.yml
dbt seed
Load CSV files from seeds/ into warehouse
dbt run
Build all models (tables and views)
dbt run --select model_name
Build a specific model only
dbt run --select +model_name
Build a model and all its upstream dependencies
dbt run --select model_name+
Build a model and all its downstream dependents
dbt run --full-refresh
Rebuild incremental models from scratch
dbt test
Run all schema and data tests
dbt test --select model_name
Run tests for a specific model
dbt build
Run seeds, models, snapshots, and tests in order
dbt snapshot
Run all snapshot models (SCD Type 2)
dbt docs generate
Generate documentation website
dbt docs serve
Start a local server to view docs
dbt source freshness
Check if source data is up to date
dbt compile
Compile Jinja to pure SQL without running
dbt clean
Delete compiled files and packages

Key Concepts Quick Reference

Materializations

TypeStored?Best ForRebuild
ViewNo (query only)Staging models, light transformsEvery query
TableYes (full copy)Mart models, heavy aggregationsFull rebuild each run
IncrementalYes (append/merge)Large fact tables, event dataOnly new/changed rows
EphemeralNo (CTE only)Intermediate calculationsInlined into parent
SnapshotYes (historical)Slowly changing dimensionsTracks changes over time

The 3-Layer Architecture

LayerPrefixPurposeMaterialization
Stagingstg_Clean raw data (rename, cast, trim)View
Intermediateint_Business logic, joins, aggregationsView or Ephemeral
Martsfct_ / dim_Final tables for dashboards & analystsTable or Incremental

Built-in Tests

TestWhat It ChecksExample Use
uniqueNo duplicate valuesPrimary keys
not_nullNo NULL valuesRequired fields
accepted_valuesOnly allowed valuesStatus columns
relationshipsForeign key existsorder.customer_id โ†’ customer.id

Top 10 dbt Mistakes to Avoid

  1. SELECT * in production models โ€” Always list columns explicitly
  2. Not testing primary keys โ€” Add unique + not_null to every PK
  3. Hardcoding schema names โ€” Use source() and ref() instead
  4. Committing profiles.yml โ€” It contains passwords! Add to .gitignore
  5. One giant model โ€” Break into staging โ†’ intermediate โ†’ marts
  6. No incremental for large tables โ€” Full refresh on 100M rows is expensive
  7. Skipping documentation โ€” Future you will thank present you
  8. Not using dbt_utils โ€” Don't reinvent the wheel
  9. Testing only in production โ€” Run tests in CI before deploying
  10. Ignoring source freshness โ€” Stale data = wrong decisions

Essential Resources

๐Ÿ“–

Official Docs

docs.getdbt.com โ€” The complete dbt reference

๐Ÿ’ฌ

Community Slack

getdbt.com/community โ€” 50,000+ members

๐Ÿ“ฆ

Package Hub

hub.getdbt.com โ€” Browse community packages

๐ŸŽ“

dbt Learn

courses.getdbt.com โ€” Free official courses