joins
10 tutorials tagged “joins”.
- CROSS JOINBuild every combination of two tables with CROSS JOIN, use it for a students-by-months calendar that shows missing months, and spot the accidental cross join.
- FULL OUTER JOINKeep unmatched rows from both sides with FULL OUTER JOIN, use it to compare two lists, and emulate it in MySQL, which has no FULL JOIN, with UNION.
- INNER JOINCombine matching rows with INNER JOIN: the ON condition, joining on two columns, filtering and grouping joined rows, and why a partial key multiplies rows.
- How Joins WorkWhy data is split across tables, how a join matches rows on a key, step by step for INNER and LEFT JOIN, the kinds of join, and how the database runs one.
- LATERAL JoinsA LATERAL join runs a subquery once for each row of the table before it. Learn top N per row, LEFT JOIN LATERAL, and CROSS APPLY in SQL Server.
- LEFT JOINKeep every row of the left table with LEFT JOIN: NULL for missing matches, finding rows with no match, counting correctly, and the WHERE mistake that undoes it.
- Joining Many TablesJoin three or more tables in one query, shorten ON with USING, avoid NATURAL JOIN and comma joins, and catch joins that duplicate rows and inflate totals.
- Project: Library DatabaseDesign and build a small library for the three sisters' books: tables, keys, constraints, sample data, then ten real questions answered in SQL.
- RIGHT JOINRIGHT JOIN keeps every row of the right table: see it as the mirror of LEFT JOIN, prove the two give the same rows, and learn why most teams rewrite it.
- Self JoinJoin a table to itself with two aliases: follow the mentor chain, show each course's prerequisite, and compare rows of the same table to find pairs.