Join combines matching rows and drops duplicate join columns for this key match.

highlighted = computed this step

Join matches keys

Equi-join keeps row pairs whose key cells are equal and drops the duplicate join key. It matters because non-matching rows disappear while matching rows can fan out. Note: this is set algebra join, not SQL NULL-aware join behavior.

 matches keys\bowtie\text{ matches keys}

Base join

In the base data, the student with no enrollment silently drops from the output. The recomputed row count is 3 and the recomputed arity is 3. Note: one left row also fans out when it matches multiple right rows.

rows=3,arity=3\text{rows}=3,\quad \text{arity}=3

set algebra not SQL bag/NULL, tiny finite tables, no product/perf claims

Joinjoin sid=sidarity 3 rows 3Studentsarity 2 rows 3Enrollarity 2 rows 3
joinsidnamecourses1AnnDBs1AnnOSs2BoDB

Added matching row

With one additional matching enrollment, the previously missing student now appears in the rendered output. The recomputed row count is 4 and the recomputed arity is 3. Note: join cardinality depends on matching keys, not just input sizes.

rows=4,arity=3\text{rows}=4,\quad \text{arity}=3

set algebra not SQL bag/NULL, tiny finite tables, no product/perf claims

Join contrastjoin sid=sidarity 3 rows 4Studentsarity 2 rows 3EnrollPlusarity 2 rows 4
joinsidnamecourses1AnnDBs1AnnOSs2BoDBs3CyDB

Summary

Join drops non-matches and fans out multiple matches. Note: SQL outer joins, duplicates, and NULL behavior are for the next book.

join summary\text{join summary}