Choose the correct SQL join
Pick the SQL join that produces the target result set.
About SQL Join Maze
SQL Join Maze shows you two or more small data tables plus a target result set and asks you to
pick the SQL join statement that produces exactly that output. Topics span INNER JOIN, LEFT JOIN,
RIGHT JOIN, FULL OUTER JOIN, anti-join patterns (LEFT JOIN … WHERE r.id IS NULL),
semi-joins, self-joins, and tricky ON vs WHERE placement that flips outer to inner behavior.
Why it helps
- Build intuition for NULL semantics — when a row disappears vs when it stays with NULLs.
- Understand cardinality blow-up from non-unique join keys before it hits production queries.
- Learn the difference between filtering in the ON clause vs the WHERE clause for outer joins.
- Use the related SQL Join Builder to iterate on the correct query with your own data.
Runs locally in your browser. Progress is stored only in this browser.
What this challenge teaches
Choose the correct SQL join is a short drill for SQL join semantics. You need to choose INNER, LEFT, anti, semi, or self join behavior to produce a target result set.
Example reasoning path
- Read the prompt and identify the artifact type before looking at the answer choices.
- Compare the expected target with each candidate result and eliminate options that are only formatting changes.
- Track unmatched rows and duplicate keys; the correct join is the one that matches the desired output, not just the table relationship.
After you solve it
Open SQL Join Builder to apply the same skill to your own data. For a broader practice loop, return to Skill Challenges or open Workflow Gallery when the task needs multiple tools.
Challenge state stays local to this browser. Do not paste production secrets into practice prompts.
Practice notes for real projects
Use this page as a warm-up before touching real project data. Read the prompt, write down the signal you are looking for, and only then compare answer choices. That habit carries over to production debugging, where the first visible error is often a symptom rather than the root cause.
After the challenge, recreate the same pattern in the linked tool with a harmless sample. For example, replace real tokens, user identifiers, hostnames, and request bodies with safe values, then verify that the same reasoning still works. This keeps practice useful without exposing private data.
- Save time by checking the smallest artifact that reproduces the issue.
- Write one sentence explaining why the wrong answers fail; that explanation is the skill to reuse later.
- If the challenge involves security, treat decoded or inspected data as untrusted until a separate verification step confirms it.