A relation's cardinality is the number of rows it currently has — and unlike degree, it changes constantly.
Why This Matters
- Pairing this with the previous chapter completes the two most basic "how big is this table" questions.
- Knowing exactly which word answers which question is a small thing that instantly signals precision in how you talk about databases.
Core Concept
- A relation's Cardinality is the count of its tuples (rows) at a given moment.
- A table can have cardinality 0 (empty) right after creation and cardinality in the millions later — cardinality is entirely about the data, not the design.
Deep Dive
- Cardinality changes every time a row is inserted or deleted — it's one of the most constantly-moving numbers in a running database.
- "Cardinality" is also used in a second, related sense later in this course — the cardinality of a relationship (like "one-to-many") — which describes how many rows on one side relate to rows on another, not just a raw row count. Keep the two uses distinct: this chapter's cardinality is a plain count; the later one describes a relationship shape.
Common Mistakes
Confusing degree and cardinality.
Why: Both sound like generic "size" words, but they answer completely different questions — degree is about columns (structure), cardinality is about rows (data).
Fix: Memorize the pairing directly: Degree = columns = structure = fixed. Cardinality = rows = data = constantly changing.
Interview Questions
What's the difference between degree and cardinality?
Degree is the number of columns in a table — a fixed, structural fact. Cardinality is the number of rows currently in the table — a constantly changing fact about the table's data.
Chapter Summary
Cardinality is a table's current row count — a data fact that changes with every insert and delete, unlike degree's fixed, structural column count.