INNER JOIN Explained
INNER JOIN keeps only rows that match on both sides. Learn the syntax, how the join condition works, and why unmatched rows silently disappear.
963 published notes across every category.
INNER JOIN keeps only rows that match on both sides. Learn the syntax, how the join condition works, and why unmatched rows silently disappear.
Outer joins keep unmatched rows and fill the missing side with NULL. Learn LEFT and RIGHT JOIN, and the one mistake that silently turns an outer join...
The three joins people meet last: keeping unmatched rows from both sides, deliberate Cartesian products, and joining a table to itself.
Building queries across four or more tables: reading a join chain, non equality conditions, join order, and keeping a long query readable.
Why a join multiplies rows, how to detect it, and the anti join patterns that answer "which rows have no match at all".
A query inside a query. Learn where a subquery may appear, what each position requires it to return, and the error a scalar subquery raises when it re...
Subqueries that return a list of values, and the three operators that consume them - including the NULL trap that makes NOT IN return nothing.
Subqueries that reference the outer row and run once per row. Learn EXISTS and NOT EXISTS, why they are NULL safe, and when correlation costs too much...
The same question answered four ways, with a straight comparison of readability, NULL safety and cost - and a rule for choosing between them.
Stacking two result sets on top of each other. Learn the column compatibility rules, why UNION ALL is faster, and where ORDER BY belongs.
The two set operations MySQL waited longest to add: rows in both sets, and rows in one set but not the other - plus how to emulate them where they are...
A CTE names a query so the rest of the statement can read it like a table. Learn single and chained CTEs, and when a CTE beats a subquery or a view.