SQL JOIN LAB — 12 Row-Count & Debugging Exercises (EN/JA)
A downloadable book
Predict the output before running the query. SQL JOIN LAB is a printable and offline practice pack for learners who know basic SELECT, WHERE and GROUP BY, and for teachers using it in their own classes.
WHAT IS INCLUDED
12 original exercises with fictional small tables, complete expected outputs, row-count explanations and reduced counterexamples. English worksheets (12 pages), English answers (12), Japanese worksheets (12), Japanese answers (12), and a Japanese-led guide with an English quick start (2): 50 PDF pages total, NOT 50 exercises. Both language editions cover the same 12 exercises. Includes 12 standalone SQLite SQL files, fixed expected-output JSON, an optional Python standard-library verifier, README, LICENSE and SHA256 manifest. Version 1.1.1.
TOPICS
Duplicate keys, unmatched rows, NULL matching, incomplete composite keys, LEFT JOIN ON versus WHERE, the failed OR IS NULL repair, COUNT, SUM(DISTINCT), two-child-table fanout, NOT IN, empty relations and aggregates, and unique self-join pairs.
REQUIREMENTS
Read or print the PDFs with a PDF reader. Run each SQL file in a fresh empty SQLite connection. Python 3 is only needed for optional automated verification, not for the PDFs or SQLite execution. No paid software or account is required. SQLite-specific semantics; other engines are not guaranteed. This is not a production database migration tool. Preview images show actual worksheet pages.
TESTING AND LIMITS
25 query alternatives checked with Python SQLite 3.53.4 and system SQLite CLI 3.51.0; 340 independent row-pair oracle comparisons; 13 reduced counterexamples / 28 queries; ZIP extraction and file hashes checked. Physical printing, classroom use, other database engines and independent language editing have not been tested.
LICENSE
One purchaser may use and adapt the material for personal study and classes they personally teach. Printed worksheets and answers may be distributed to those students. Digital distribution is limited to worksheet/answer PDFs in a class-restricted channel. No public redistribution, resale, source-package sharing or public posting of blank worksheets. Institution-wide or multi-teacher sharing requires separate permission. Full terms are in LICENSE.txt.
AI DISCLOSURE
Generative AI participated in writing the exercises and explanations, translation, SQL and verifier code. The fictional datasets and outputs were checked as described above.
Price: USD 4.99. Digital download.
Purchase
In order to download this book you must purchase it at or above the minimum price of $4.99 USD. You will get access to the following files:


Leave a comment
Log in with itch.io to leave a comment.