The Case Files
SQL ideas explained as murder investigations. Each article takes one concept that trips people up and solves it with a real case from the game.
- Short reads with example queries
- For beginners and interview prep
- Each one links to a case to try it
SQL JOINs Explained: The Suspect With No Record
INNER JOIN keeps only the matches. LEFT JOIN keeps everyone. Here's why your join returns no rows and how the one missing row cracks Case 4.
WHERE vs HAVING in SQL: The Alibi Problem
WHERE filters rows, HAVING filters groups — and swapping them is why Invalid use of group function keeps happening. Here's exactly when to use each.
SQL Order of Execution: Your Query Doesn't Run Top to Bottom
You wrote SELECT first. SQL read it sixth. Here's the real order clauses run in — and why it explains three of the most baffling beginner errors.
Prefer to learn by doing? Start Case 1 — no account, no setup. Or follow the SQL learning roadmap.