01
A real engine, not a checker
SQLite itself, compiled to WebAssembly, runs in your tab. Hit Run and the actual result table appears. No round-trip, no queue, no waiting to find out you had a typo.
The daily SQL puzzle where shortest wins
One puzzle a day: a small schema, a plain-English goal, and a real SQLite database running in your browser. Getting it working is the easy part. Your score is the UTF-8 byte length of your query, and the board sorts ascending.
No account. No server round-trip. The engine runs in your tab.
01
SQLite itself, compiled to WebAssembly, runs in your tab. Hit Run and the actual result table appears. No round-trip, no queue, no waiting to find out you had a typo.
02
Your query is graded against seeded databases you never see: empty groups, ties, NULLs, negatives. A query that fits the sample you can see and nothing else fails, exactly as it should.
03
Not points, not stars. The UTF-8 length of your query, counted honestly, so you can't buy a lower score with clever characters. Everyone solves the same puzzle on the same day.
You open the day's puzzle and read two things: a schema of two or three small tables, and one sentence describing the rows you have to return. Say the goal is each customer's total spend, highest first, skipping anyone who never ordered. You write the obvious query, the one you'd put in a pull request. It runs against a real SQLite database in the browser, the result table appears under the editor, and the byte counter reads 126.
That's the starting line, not the finish. Now you start cutting. The alias goes. The
AS total goes, because ORDER BY 2 can point at the column by
position. JOIN ... ON becomes a comma join and a WHERE clause.
Whitespace the parser doesn't need goes. Every cut is one Run to prove you didn't break
it, and the counter ticks down: 113, 101, 96. Somewhere below that is a query you
haven't thought of yet, and someone else already has.
Submit grades you against fixtures you never see. This is the part that makes the score mean something. It's easy to write a query that happens to produce the right two rows for the sample data on screen, and much harder to write one that also survives a customer with no orders, a refund that drives a total negative, and two customers tied on the same amount. If your query only fits what you can see, Terseql tells you it passed the sample and failed a hidden case, and it doesn't tell you which one. Working that out is the puzzle.
Terseql 2026-07-16 — Top Spenders 🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦 126 🟦🟦🟦🟦🟦🟦🟦🟦🟦 113 🟦🟦🟦🟦🟦🟦🟦🟦 101 🟩🟩🟩🟩🟩🟩🟩🟩 96 96 bytes (4 cuts) 🔥 4-day streak https://apps.charliekrug.com/terseql
Your golf trail as a shrinking staircase. It carries no query text, so posting it can't spoil the day for anyone.
GROUP BY ordinals all work. Anything SQLite rejects, Terseql rejects, with
the same error message.
DROP TABLE orders costs you nothing but bytes. Grading always uses its own
databases, never the one you've been poking at.
Come back tomorrow for the next one.
Play now →