Interview Question

What is cardinality?

Cardinality describes row count or relationship multiplicity, depending on context.

💡 Concept ✅ Quick Revision 🗃️ SQL

Answer

Cardinality can describe the number of rows in a relation or the relationship multiplicity between entities. • Query optimizers estimate row cardinalities to compare plans. • Data modeling uses terms such as one-to-one and one-to-many. • The intended meaning should be stated because the term is context-dependent.

💡 SQL Example

SELECT COUNT(*) FROM employees;

Result

The table row cardinality

⚡ Quick Revision

Cardinality describes row count or relationship multiplicity, depending on context.