Cardinality describes how many related rows can exist on each side of a relationship, and relatedly, how many distinct values a column has.
Relationship cardinality
- One-to-one: person ↔ passport number
- One-to-many: customer ↔ orders
- Many-to-many: student ↔ courses
customer (1) ----< (many) orders
Column cardinality
- Low:
country_code(hundreds of values) - High:
user_id,email(millions)
Why DEs care
- Join design and fan-out risk
- Partition and Z-order choices (avoid ultra-high-cardinality partition keys)
- Bridge tables for many-to-many
- Estimate of junk-dimension size (product of low-cardinality flags)
Interview tip
Clarify whether they mean relationship cardinality or distinct-value cardinality, then give both briefly if unsure.