Cartesian product pairs every row on the left with every row on the right.

highlighted = computed this step

Product pairs every row

Cartesian product pairs each left row with each right row. It matters because joins can be understood as product followed by a match filter. Note: product adds arities and multiplies cardinalities.

× pairs rows\times\text{ pairs rows}

Full product

The recomputed arity is 4 and the recomputed row count is 9. Note: every student row is paired with every enrollment row.

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

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

Productproductarity 4 rows 9Studentsarity 2 rows 3Enrollarity 2 rows 3
productleft.sidnameright.sidcourses1Anns1DBs1Anns1OSs1Anns2DBs2Bos1DBs2Bos1OSs2Bos2DBs3Cys1DBs3Cys1OSs3Cys2DB

Small product

The same rule holds for smaller inputs. The recomputed arity is 2 and the recomputed row count is 4. Note: the rule generalizes beyond the named base relations.

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

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

Small productproductarity 2 rows 4TinyLeftarity 1 rows 2TinyRightarity 1 rows 2
productab110120210220

Summary

Product is the broad pairing operator; join narrows those pairs by matching keys. Note: SQL duplicate and NULL behavior are deferred to the next book.

product summary\text{product summary}