Relational Algebra
Relation is a Set
A relation is a finite set of typed rows with no duplicate row.
Relations before SQL
Honesty note: set algebra not SQL bag/NULL, tiny finite tables, no product/perf claims. This book uses set semantics: no duplicate rows and no NULLs; bag or multiset duplicates and NULL behavior are covered in the next book. Note: arity means column count, and cardinality means row count.
Students as a relation
The first relation displays student identifiers paired with names. Its recomputed arity is 2 and its recomputed cardinality is 3. Note: the order shown is canonical display order, not author-supplied truth.
set algebra not SQL bag/NULL, tiny finite tables, no product/perf claims
Enroll as a relation
The second relation displays enrollments with the same set rule: a duplicate row would be rejected. Its recomputed arity is 2 and its recomputed cardinality is 3.
set algebra not SQL bag/NULL, tiny finite tables, no product/perf claims
Summary
A relation is a set of typed rows with arity and cardinality as separate facts. Note: SQL duplicate-preserving behavior and NULL behavior belong to the next book.