#joins Clear
Tags #php #kotlin #bash #go #sql #rust #typescript #html #java #python #files #utils #strings #http #concurrency #async #json #arrays #security #types #crypto #database #dates #format
SQL FULL OUTER JOIN / CROSS JOIN
`FULL OUTER` keeps unmatched rows from BOTH sides. `CROSS JOIN` is the Cartesian product — every row of A paired with every row of B. Rare but useful for date-spine and matrix generation.
SQL LEFT JOIN — Keep Unmatched Left Rows
Returns every row from the LEFT side, NULL-filled where the right side doesn't match. The standard pattern for "this entity and its optional children".
SQL Self-Join — Org Chart / Hierarchies
A self-join is just a regular join with the same table aliased twice. The canonical example is an employee table where each row points to a manager in the same table.
SQL INNER JOIN — Match Rows in Both Tables
Returns rows where the join condition matches in BOTH tables. The default JOIN. Use table aliases (`u`, `o`) for readability when joining 3+ tables.