AI engineering glossary · SQL databases

What is cardinality?

Cardinality: In indexing and optimisation, the number of distinct values in a column; in modelling, the count of related rows (one-to-many). The optimiser uses estimated cardinality to judge the size of intermediate results.

Level: advancedTopic: SQL databases

Cardinality: an example

A country column with 30 distinct values has low cardinality; user_id in a users table has high cardinality.

Related terms

More SQL databases terms

Where you learn it

Cardinality is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.