SQL Dojo

Agentic analytics

Agents write the SQL; you check their work. Read an analytics agent's run, find where it went wrong, say why and fix it; then give it the context, the tests and the limits that make it reliable. On real data, in your browser.

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

    20 steps Free

    Read the agent's run: the question, how it explored the tables, its SQL, its answer. Tap the line where it went wrong and say why. Reading a join is enough.

    • Read the agent's run
  2. Yellow belt

    15 steps

    Fix the agent's SQL: a fan-out, the wrong date column, a period not over, NOT IN with a NULL, an average of ratios, a history summed. Needs the SQL orange belt.

    • Fix the agent's SQL
  3. Orange belt

    12 steps

    Metrics defined once: one revenue, a metric that holds under every grouping, a population named once, the marts an agent can answer from. Needs the SQL orange belt.

    • Metrics the agent can't get wrong
  4. Green belt

    21 steps

    Context beats prompting: which tables to give the agent, descriptions it can use, the grain in one sentence, allowed values, a semantic layer; its answers with and without them. Needs the SQL orange belt.

    • Give the agent its context
  5. Blue belt

    9 steps

    Check what the agent changed: a refactor that must give the same rows, what a renamed column breaks downstream, the input rows that break its model, the runs to skip on stale data. Needs the SQL orange belt. Done Analytics engineering? This belt is a review: the same tests, applied to an agent's changes.

    • Check what the agent changed
  6. Brown belt

    18 steps

    Evals: a golden set from the questions people ask, a grader with a tolerance, pass@k, regressions after a change, triaging the failures. Needs the SQL green belt.

    • Evals
  7. Black belt

    14 steps

    Governance, then the final audit: instructions hidden in the data, what the agent may see, the cost of its queries, a dashboard debugged with it; then a whole agent run to audit. Needs the SQL green belt.

    • Governance and the final audit