Puzzle Master · Logic
Query Quarry
Filter, sort, total and join invented tables to run real database queries.
Play Query Quarry More Puzzle Master games
- Ages 11 to 14
- Learning game
- Plays in the browser

About Query Quarry
Query Quarry is a database game for children aged 13 and 14 who are learning SQL. Each crate on the quarry belt is one row of a table, and players build query gates from blocks to choose which rows pass through.
The game covers WHERE, AND and OR, ORDER BY, COUNT and SUM, primary and foreign keys, and joins between two tables. All the gems, stock, mines and pets are invented, and the SQL is simplified: inner joins only, up to two tests, and no GROUP BY.
How to play
- Drag blocks into the query gate to choose the rows, such as a WHERE test on one column.
- Use AND or OR to join two tests, and add SELECT or ORDER BY where a job asks for them.
- Link two tables by dragging a foreign key onto the primary key it points at, then choose the columns.
- Pick the primary key by testing which column is different on every row, then press Run belt.
Questions about Query Quarry
What is a primary key in a database?
A primary key is a column whose value is different in every row and is never empty, so each row can be told apart. A table has one primary key, and another table points at it with a foreign key.
#What is the difference between AND and OR in a query?
AND keeps a row only if both tests are true, while OR keeps it if at least one test is true. In the stock jobs, bin A with fewer than 10 items needs AND, and the total for bins B or C needs OR.
#Does Query Quarry teach GROUP BY?
No. The game uses inner joins only, at most two WHERE tests, and no GROUP BY, so mixing COUNT or SUM with ordinary columns is refused with a message.
#Can my child play Query Quarry without paying?
Yes. Query Quarry is a learning game for children on play.3dw3b.com. It runs in any modern web browser on phones, tablets, Chromebooks and computers, so there is nothing to download.
#More games like Query Quarry

Bead Sort
Sort the coloured beads until every tube holds one colour.
Ages 6 to 12
Light Path
Turn the tiles to carry the light from start to finish.
Ages 7 to 12
Pattern Lab
Explore nine puzzle rooms: patterns, picture grids and balance scales.
Ages 5 to 14
Matter Mixer
Heat, cool, sieve, filter and bond: solve lab-bench puzzles in the fewest moves.
Ages 5 to 14
Tangram Builder
Slide, turn and flip the seven tangram pieces to build boats, fish, rockets and more, then design your own.
Ages 5 to 14
Network Hero
Send data packets across a network! Drag them past routers and broken cables, then put numbered packets back in order.
Ages 8 to 14
Want games like these for your organisation?
We design custom and white-label learning games for schools, academies, charities and companies.