SQL and dbt debugging practice

Find where the numbers go wrong.

The dashboard says revenue is up, finance's ledger says it isn't, and the query runs without an error. Each challenge gives you the tables, the SQL or dbt models, and a report someone doesn't trust. Trace where it goes wrong, then fix it.

  • 57 data challenges
  • SQL, dbt and Python
  • inspect the tables
  • graded by hidden checks
  • free · no signup to try

What you practice

01

SQL that runs and lies

Fan-out joins that double revenue, NULLs inside NOT IN, window frames that tie, month-end boundaries. Query the tables in the scratchpad until you see it.

02

dbt projects, not snippets

Multi-file projects with seeds, staging models and the models built on them. Follow a number from the source through each model to the report that gets it wrong.

03

Pipelines that fail halfway

Python and JavaScript pipeline code: retries that duplicate records, replays that resurrect deletes, cursors and watermarks that skip rows.

Joins and aggregates
Fan-out joins, NOT IN with NULLs, integer division, NULLs in averages, groups that vanish when they have no rows.
Time and ordering
Date boundaries, half-open intervals, latest-row-per-key, running balances with tied timestamps, NULL-safe pagination.
Incremental and recovery
Incremental model watermarks, stale event rollups, partial batch failures, idempotent retries, event replay.

The challenges

Shortest first. No signup to try one.

SQL · 34

comprehensionsnippetsql~5 min

How many active accounts does each plan have?

comprehensionsnippetsql~5 min

Where does team C place on the leaderboard?

comprehensionmodulesql~6 min

How many June events does the report count?

comprehensionmodulesql~6 min

Which invoices does the cleanup query return?

comprehensionmodulesql~7 min

What does the open-task dashboard return?

comprehensionmodulesql~7 min

Which status does each workspace show?

comprehensionmodulesql~8 min

Does the row with a NULL timestamp reach a later page?

debugmodulesql~10 min

Activation trend drops days with zero devices

debugmodulesql~10 min

Inventory on hand rises after stock leaves the warehouse

debugmodulesql~10 min

Survey score averages by segment look too low

debugmodulesql~11 min

Daily GMV is higher than finance's ledger

debugmodulesql~11 min

High-volume buyers are missing or showing deflated totals

debugmodulesql~12 min

Closed tickets keep showing up in the open triage queue

debugmodulesql~12 min

Combined online and store sales come back too low

debugmodulesql~12 min

Course pass rates all come back as zero

debugmodulesql~12 min

Discontinued product appears in active pick-list report

debugmodulesql~12 min

List of never-returned products comes back empty

debugmodulesql~12 min

May revenue report misses final-day orders

debugmodulesql~12 min

Paid invoice report doesn't match finance's ledger

debugmodulesql~12 min

Product star ratings all come back suspiciously low

debugmodulesql~13 min

Agents with no high-priority tickets vanish from the report

debugmodulesql~13 min

Coupon redemption report does not match finance's order numbers

debugmodulesql~13 min

June partner payouts don't match the month-end close

debugmodulesql~13 min

Plan engagement report shows more active accounts than some plans have

debugmodulesql~13 min

Support first-response times look too fast

debugmodulesql~14 min

June active-workspace report lists the wrong workspaces

debugmodulesql~14 min

Per-customer invoiced totals don't match the ledger

debugmodulesql~14 min

Per-customer spend totals are higher than finance expects

debugmodulesql~14 min

Week-one retention reports more users than came back

debugmodulesql~15 min

The current price report duplicates one product

debugmodulesql~15 min

Two payments share a timestamp and jump the running balance

debugmodulesql~16 min

Cancelled subscriptions remain active for an extra day

debugreposql~22 min

Category scorecard undercounts listings and lets a low-rated category in

debugreposql~25 min

Billing health rollup uses stale subscription events

Filter data engineering in the catalog →

Questions

Who is this for?
Analytics engineers, data engineers and anyone who owns a report people make decisions with. Most of the job is reading SQL someone else wrote and working out why a number is off.
How is it graded?
Debug challenges run your fixed query or model against hidden checks on the data, so it has to be right for the rows you didn't look at too. Reading challenges ask what a query returns.
Is it free?
Yes. You can open and solve any challenge without an account. Sign up to keep your progress and streak.
What else is on ReadTheCode?
Reviewing pull requests written by AI agents, and debugging multi-file Python and JavaScript codebases. All of it is about reading code you didn't write.