0 votes
Cardinality is defined as follows in my school text Database Systems:

A relation's cardinality is the number of tuples it contains. The cardinality of the relation, on the other hand, refers to the number of tuples in the relation, which changes when tuples are added or removed. Many tuples in high-cardinality, few tuples in low-cardinality.

Cardinality (SQL statements) is defined as follows in the Wikipedia article:

The uniqueness of data values included in a single column (attribute) of a database table is referred to as cardinality. In a column, the smaller the cardinality, the more duplicated components there are. Cardinality is divided into three categories: high cardinality, normal cardinality, and low cardinality.

They might both be correct, but I can't see how the two definitions are linked. A response would be much appreciated!
Feb 15, 2022 in Database 1,560 views

## 1 answer to this question.

0 votes
Cardinality is defined as the "number of rows" in both definitions. The distinction is whether the comparison takes place "in the table" or "in a specific column."
The version in your database text book focuses on relational algebra and the construction of tables.
The Wikipedia article is more useful. If the table has a primary key, it meets the textbook definition (the cardinality of the primary key is the same as the table). It can, however, be used on a flag column, for example. We may argue that the cardinality of the column is 2 if the flag only accepts two values (0 and 1).

This is critical for query optimization. Cardinality is one factor to consider when deciding which methods to use for joining, aggregating, and selecting data. In fact, most databases employ more information than cardinality for optimization, such as "statistics" about columns and their values.
answered Feb 15, 2022 by
• 9,060 points

0 votes
0 answers

## What is the purpose of Order By 1 in SQL select statement?

I discovered numerous views with an order ...READ MORE

0 votes
0 answers

## What is the purpose of using WHERE 1=1 in SQL statements?

Possible Duplicates: Why would a sql query have ...READ MORE

0 votes
1 answer

## What is the use of a cursor in SQL Server?

Instead of receiving a result set as ...READ MORE

0 votes
1 answer

## What is the equivalent of 'describe table' in SQL Server?

Use the sp_columns stored procedure: exec sp_columns MyTable I hope this ...READ MORE

0 votes
0 answers

## What is the definition of cardinality in SQL?

My book definition of Database Systems does ...READ MORE

0 votes
1 answer

## Best way to get average values within a specific set of time(say, date or year) using MySQL or Rails

I don't think post-process is what you ...READ MORE

0 votes
1 answer

## How to change the default value and to alter a column in sql?

Hi, You can try this: ALTER TABLE foobar_data CHANGE ...READ MORE

0 votes
1 answer

## What is an index in SQL?

An index is used to speed up ...READ MORE

0 votes
1 answer

## What is the candidate key in SQL Server?

A Candidate Key is any column or ...READ MORE

0 votes
1 answer

## Ordering by the order of values in a SQL IN() clause

Use MySQL's FIELD() function: SELECT name, description, ... FROM ... WHERE id ...READ MORE