Town Errands: learn SQL by running errands
Six errands around a tiny town. Type real SQL (SELECT, WHERE, ORDER BY, GROUP BY, JOIN); it runs in a small database inside this page. Nothing is uploaded and nothing is tracked.
Loading the town...
Town database
Click a table name to peek at its rows.
Mini cheat sheet
SELECT col1, col2 FROM table WHERE col = 'text' AND num > 3 ORDER BY num DESC LIMIT 5 SELECT col, COUNT(*), SUM(num) FROM table GROUP BY col HAVING COUNT(*) > 2 SELECT a.x, b.y FROM a JOIN b ON a.b_id = b.id