GUIDEDeep dive
SQL JOIN Types and Usage
JOIN combines tables on a key: INNER keeps matches, LEFT keeps all left rows. Put join conditions in ON and filters in WHERE; decide what one row means before GROUP BY.
Types
INNER JOIN: matches on both sides.
LEFT JOIN: keep all left rows; missing right values are NULL.
CROSS JOIN: Cartesian product.
Aggregation
JOIN can multiply rows.
COUNT(*) counts rows; COUNT(col) ignores NULL.
FAQ
ON vs WHERE?
ON controls the join; WHERE filters results, especially with LEFT JOIN.
Does join order matter?
Not logically; it can matter for performance.
Sources
Related calculators
Advanced SQL: 1000 Gamified JOIN and Subquery Cards1000 advanced SQL cards covering JOIN, GROUP BY/HAVING, subqueries, EXISTS, CASE and window functions, in 50 levels with spaced repetition.More guides
Hiragana vs KatakanaRead guideSpaced Repetition and the Forgetting CurveRead guideOn Readings vs Kun ReadingsRead guideAn N5 Kanji Study OrderRead guideKEEP READING
Keep reading
Read in order, or jump to another guide on the same topic.
← PreviousDirect, Inverse and Proportional Sharingy=kx, xy=k and sharing by parts.Next →Subqueries, EXISTS and Window FunctionsIN/EXISTS, correlated subqueries and ROW_NUMBER.