Cardinality (SQL statements)
In SQL (Structured Query Language), the term cardinality refers to the uniqueness of data values contained in a particular column (attribute) of a database table.[src] The lower the cardinality, the more duplicated elements in a column.[src] Thus, a column with the lowest possible cardinality would have the same value for every row.[src] SQL databases use cardinality to help determine the optimal query plan for a given query.[src]
In SQL (Structured Query Language), the term cardinality refers to the uniqueness of data values contained in a particular column (attribute) of a database table.[src] The lower the cardinality, the more duplicated elements in a column.[src] Thus, a column with the lowest possible cardinality would have the same value for every row.[src] SQL databases use cardinality to help determine the optimal query plan for a given query.[src] ==Values of cardinality== When dealing with columnar value sets, there are three types of cardinality: high-cardinality, normal-cardinality, and low-cardinality.[src] High-cardinality refers to columns with values that are very uncommon or unique.[src] High-cardinality column values are typically identification numbers, email addresses, or user names.[src] An example of a data table column with high-cardinality would be a USERS table with a column named USER_ID.[src] This column would contain unique values of 1-n.[src] Each time a new user is created in the USERS table, a new number would be created in the USER_ID column to identify them uniquely.[src] Since the values held in the USER_ID column are unique, this column's cardinality type would be referred to as high-cardinality.[src] Normal-cardinality refers to columns with values that are somewhat uncommon.[src] Normal-cardinality column values are typically names, street addresses, or vehicle types.[src] An example of a data table column with normal-cardinality would be a CUSTOMER table with a column named LAST_NAME, containing the last names of customers.[src] While some people have common last names, such as Smith, others have uncommon last names.[src] Therefore, an examination of all of the values held in the LAST_NAME column would show "clumps" of names in some places (e.g.[src] a lot of Smiths) surrounded on both sides by a long series of unique values.[src] Since there is a variety of possible values held in this column, its cardinality type would be referred to as normal-cardinality.[src] Low-cardinality refers to columns with few unique values.[src] Low-cardinality column values are typically status flags, Boolean values, or major classifications such as gender.[src] An example of a data table column with low-cardinality would be a CUSTOMER table with a column named NEW_CUSTOMER.[src] This column would contain only two distinct values: Y or N, denoting whether the customer was new or not.[src] Since there are only two possible values held in this column, its cardinality type would be referred to as low-cardinality.[src] ==See also== Cardinality (mathematics) ==References==[src]
28 sentences · 28 cited inline · 0 references stored
References
No reference rows published for this article.
Cite this article
MLA
"Cardinality (SQL statements)." encyclopegia.org, 2026, https://encyclopegia.org/wiki/cardinality-sql-statements. Accessed 25 November 2026.
Chicago
"Cardinality (SQL statements)." encyclopegia.org. Accessed November 25, 2026. https://encyclopegia.org/wiki/cardinality-sql-statements.
APA
encyclopegia.org. (2026). Cardinality (SQL statements). Retrieved November 25, 2026, from https://encyclopegia.org/wiki/cardinality-sql-statements
Accessed November 25, 2026 · CC BY-SA 4.0 · citation page · JSON