SQL Dojo

Analytics engineering

Design and build reliable tables from raw data: keys, normal forms, tests, staging, star schemas, incremental loads, history, metrics. In plain SQL; each belt maps to a dbt concept.

  • 170+ exercises
  • 7 belts
  • white belt free, no account needed
Start the white belt →
  1. White belt

    21 steps Free

    Know your table: keys, one-to-many and many-to-many, grain, NULLs, orphans, with tests written as queries (dbt: generic tests). Needs the SQL orange belt.

    • Keys and relationships
    • Know your table
  2. Yellow belt

    21 steps

    Normalize or not, then stage a raw source: anomalies, normal forms, names, types, empty values, duplicates, personal data (dbt: staging models). Needs the SQL orange belt.

    • Normalize or denormalize?
    • Stage a raw source
  3. Orange belt

    29 steps

    Design a star schema, then build marts without changing the numbers: grain, facts and dimensions, layers, reconciliation, metrics defined once for people and AI agents, then what changes from one warehouse to another (dbt: ref(), marts, materializations). Needs the SQL green belt.

    • Facts and dimensions
    • Build a mart
    • Metrics defined once
    • One query, several warehouses
  4. Green belt

    27 steps

    Load it again tomorrow, and check every load: incremental loads that are safe to rerun, late data, backfills, then monitors for freshness, volume and broken rules, and shipping a change: select, lint and rebuild only what it touches (dbt: incremental models, source freshness, selectors, slim CI). Needs the SQL green belt.

    • Load it again tomorrow
    • Check every load
    • Ship a change
  5. Blue belt

    21 steps

    Keep history and query it: slowly changing dimensions, snapshots, versions, change detection, as-of queries, a first Data Vault (dbt: snapshots). Needs the SQL green belt.

    • Model history
    • Keep history
    • Data Vault
  6. Brown belt

    26 steps

    Metrics you can defend, and their changes explained: one definition, MRR, churn, funnels, ratios and denominators, results not known yet, then volume against value, mix against rate, segments and seasonality, and the SQL a semantic layer writes (dbt: metrics, semantic layer). Needs the SQL green belt.

    • Metrics you can defend
    • A semantic layer in SQL
    • Explain a change
  7. Black belt

    16 steps

    Review and ship: whole models with several defects, a model ported to another warehouse, hard modeling, write-audit-publish, personal data, then a whole project from raw tables to marts. Needs the SQL green belt. AI agents on your data (golden sets, evals, verified queries) have their own track: Agentic analytics.

    • Review and translate
    • Hard modeling
    • Personal data
    • Capstone: a SaaS project