This page assumes nothing. Before you can read the parent note Joins, you need to know exactly what a table, a row, a key, a NULL, a "match", and a handful of symbols mean. We introduce no symbol before defining it — every piece of notation gets a plain-words meaning and a picture in the section where it first appears, in the order the ideas depend on each other.
Look at the figure. The whole blue-bordered box is the Employeestable. The horizontal strip highlighted in orange is one row — it is Asha, and everything true about Asha. The vertical strip in green is one column — the name property across all employees. Where they cross (the darker square) is one cell, holding the single value Asha.
The figure shows the two worlds side by side. On the left (red) is the un-normalized table: "Sales" is copied onto every Sales employee — three copies of the same fact. On the right (green) is the normalized pair of tables: the word "Sales" appears once, and each employee stores only a tiny reference to it.
In the figure, the arrow is the whole point. Employees.dept_id = 10 is a foreign key: it is not the department's name, it is a pointer to the department whose primary keydept_id = 10. The name "Sales" lives once, in Departments — exactly the normalization idea from section 2, now made concrete by the id.
Before any symbols, internalise this picture — it is the whole topic.
Two overlapping circles (a Venn diagram). The left circle is all Employees rows; the right is all Departments rows. They overlap where a foreign key finds its primary key.
Overlap (purple): rows that match — Asha ↔ Sales. These are the only rows an INNER JOIN keeps.
Left-only (blue): left rows with no partner — Bilal (dept 20 missing), Cara (dept NULL).
Right-only (orange): right rows with no partner — Legal (no employee).
Every join in the parent note is just a choice of which coloured regions to keep. Memorise the three regions and the six joins become trivial.
The parent note's derivation writes joins in the language of Relational Algebra. Here is every symbol, earned one at a time, and then all six joins written in that language.
The grid in the figure is the product. Down the side: the 3 employees. Across the top: the 2 departments. Each of the 3×2=6 inner cells is one pair — one possible combined row. This is the raw material a join filters. Notice: nothing has matched yet — every combination exists, even nonsensical ones like "Asha paired with Legal".
Why a symbol instead of the words? Because the shape of the join is the same whatever the condition is — equality, less-than, or a compound AND. Writing θ lets us describe all of them at once.
Now the INNER join reads in plain English:
INNER=σθ(A×B)
"Take every employee–department pair (A×B), then keep only the pairs where the ids match (σθ)." That surviving set — the purple overlap in figure s03 — is the INNER JOIN. Nothing mysterious: product, then filter.
With these, every outer join is INNER plus the lonely rows padded with {NULL}:
The figure shades each join's kept regions on the same Venn picture so you can see that RIGHT is the exact mirror of LEFT (swap blue for orange), and FULL is simply both outer regions added to the INNER core.
Now the parent's counting check is fully readable. With INNER =1, Lu={Bilal, Cara} so ∣Lu∣=2, and Ru={Legal} so ∣Ru∣=1:
∣LEFT∣=1+2=3,∣RIGHT∣=1+1=2,∣FULL∣=1+2+1=4.
Related deeper topics once you're comfortable: Indexes (how the engine avoids materialising the full product), GROUP BY and Aggregation (what you often do after joining), and Foreign Keys (which guarantee matches exist).