← back to projects
November 2026

A SQL gym for an audience of one

My girlfriend is learning to be a data analyst and a developer at the same time, which is a lot to take on at once. Not long ago she landed an interview for a role that would put SQL in front of her on day one, and the interview was going to test it. She did not have much time.

Every SQL tutorial I've ever seen teaches with the same table. It's called employees or customers, it has a salary column, and nothing in it means anything to you. You can learn SELECT that way. What you can't learn is the part interviews actually test: someone hands you a business question and you have to work out which tables answer it.

So instead of sending her a list of tutorials, I sat down with Claude and built her one page. It runs in the browser, there's nothing to install, and it was built for exactly one person. We called it the SQL Practice Gym.

Fake data, real shape

The company she was interviewing with runs grocery stores, so the gym does too. Six stores. Twenty-four products across six departments, from produce to deli. And a sales table with 3,948 rows: one product, one store, one day, for every day of September.

Every number is invented, and the page says so up front. But it's invented on purpose. Weekends sell more. One store is clearly the busiest. Three products are deliberately not stocked at certain stores, so when she gets to LEFT JOIN there's actually something to find. Real data is lumpy. Practice data should be too, or your queries never surprise you.

The whole dataset on one tab: three tables, and what one row of each means.

One note for the pedants, a group that includes me: the job runs MySQL, and the gym runs SQLite inside the page. For everything she needed (joins, grouping, CTEs, window functions) the syntax lines up, and running in a browser tab meant zero setup between her and the first query.

Teach in her language

The lessons are where Claude earned its keep. There are twelve of them, about 90 minutes end to end, starting at "what is a database" and finishing at window functions. The analogies aren't the generic ones. A table is a gradebook: each row is a student, each column is a fact about them. A primary key is a student ID number. GROUP BY is averaging test scores per class period instead of for the whole grade. PARTITION BY is ranking students within each class period.

Those come from her world, not mine, and that was the point. A new concept sticks faster when you hang it on something you already understand completely.

Every lesson has examples you can run with one click, a short list of the mistakes people really make (double quotes around text, a SUM() stuck in a WHERE, a forgotten ON that makes the row count explode), and a small "try it" before you move on.

Lesson 00. A table is a gradebook.

The answers are there, just not easy to reach

This was the tension I cared about most. An AI tutor that hands you the answer the moment you ask is a fast way to feel prepared without being prepared. So the gym is built to slow that down, a little:

  • Starter queries are unfinished on purpose. Run one as-is and the page tells you so, instead of throwing a scary error.
  • Hints come before solutions. The hint points at the right clause. The solution is a separate button.
  • The solution comes with instructions: "Read it, close it, then try typing it yourself. That's how it sticks."
  • The grader checks results, not text. There's more than one right way to write a query, so column names don't have to match, only the values. When she's wrong, it says how: wrong number of columns, wrong number of rows, or my favorite, "The right rows, but in a different order. Check your ORDER BY."

That last message is the kind of feedback a good teacher gives. You don't hear "wrong." You hear where.

Exercise 8, with the starter query left unfinished on purpose.

Ten reps, easy to stretch

Ten exercises ramp from "Cheap produce" (filter for produce under $3) up to month-to-date revenue across every store. In between are the top five priciest items, revenue by store, a join to put store names on the numbers, a HAVING filter, "What never sold?", the top three products per store, and one store's day-over-day change.

Each exercise carries a one-line "why it matters" that ties it to something a grocery company would really ask. Store-level totals are the backbone of a store director's dashboard. "How did we do vs. yesterday?" gets asked every morning. Month-to-date vs. goal is on nearly every leadership dashboard. I wanted her to walk into the interview having already answered their questions once, just with fake numbers.

Syntax is half of it

The last lesson has almost no new syntax. It's called "Thinking like an analyst," and it's a six-step routine for any request: restate the output, find the tables, filter, group, sort, then sanity-check. There's a cheat sheet that translates error messages into plain English ("misuse of aggregate" means you put a SUM in your WHERE). And one warning I'd hand to every new analyst: a join that duplicates rows still returns a nice-looking table.

Then there's a deck of flashcards, because the interview wasn't only a SQL test. Cards on the company's history and how it uses data, warehouse vocabulary (fact vs. dimension tables, what "grain" means), the BI tool they run on, and grocery metrics like shrink, same-store sales, and promo lift. It's the kind of thing you can flip through in the parking lot ten minutes before you walk in.

Friday

Solve the tenth exercise and the page says: "That's all 10. You're ready to talk window functions on Friday."

We wrote that line hoping it would be true. How Friday went is her story to tell, not mine.

Most of what I build with Claude, I build for myself. This one had exactly one user, and she wasn't me. That turns out to make for a better brief. You stop building what impresses you and start building what one specific person needs the week of an interview.