A workbench with a spreadsheet monitor and a query console, running on one small invented shop. Step through SELECT, WHERE, ORDER BY, GROUP BY and JOIN, watch a duplicate key inflate a report, and finish by choosing the one correct query out of three.
The brief it was built from
A learning path for someone fluent in spreadsheets who is new to SQL: from the habits they already have (formulas, filters, sorting, pivot tables, VLOOKUP) to writing queries, with hands-on steps and a closing task.
What is real, and what is a scenario
Real data
- Every result on the console is computed in the page by a small query engine (engine.js) from the shop's tables; nothing on the screens is drawn by hand
- The engine's answers are checked by build/test.mjs: Chennai earns ₹3,570 of ₹6,465, four customers ordered at least twice, two never ordered, and a duplicated customer row turns 12 joined rows into 15
- The SQL clauses shown (SELECT, WHERE, ORDER BY with LIMIT, GROUP BY, HAVING, INNER and LEFT JOIN ... USING, IS NULL) are standard SQL and behave as shown in PostgreSQL, SQLite and MySQL
- VLOOKUP's exact match returns the first match it finds, which is why a duplicated key goes unnoticed in a sheet and not in a join
Scenario & assumptions
- The shop is invented for teaching: 8 customers (first names only, all fictional), 12 orders, three items and three cities. It is not real sales data
- No outside source could be fetched in this run (the network was blocked), so the page states only long-stable facts about SQL and spreadsheets; the cited pages were not re-read on the day, and the card about the size of a worksheet (about a million rows) is flagged on screen as something to check against Microsoft's current page
- Dialect notes (LIMIT versus TOP, USING not supported by SQL Server) are from general knowledge and should be checked against the database you use
- The 'Your footing' meter is illustrative: it starts higher for people who already use pivot tables or VLOOKUP and rises step by step; it is not a measurement of learning
- Four minutes is the autoplay pace; hands-on steps take longer
- The pasted-twice customer in the pitfall step is a scenario chosen to show the effect; real duplicates vary
What you leave with
- Each spreadsheet habit has a SQL clause: filter is WHERE, sort is ORDER BY, pivot is GROUP BY, VLOOKUP is JOIN
- WHERE filters rows before grouping and HAVING filters groups after
- A join returns every match, so count the rows before and after it and compare the total with the source
- A query can run without error and still answer a different question
Sources
3D with three.js (MIT)