What is the definition of cardinality in SQL

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 by Vaani
• 7,070 points
1,858 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 Neha
• 9,020 points

Related Questions In Database

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

Aug 19, 2022 in Database by Kithuzzz
• 38,000 points
682 views
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

Aug 28, 2022 in Database by Kithuzzz
• 38,000 points
2,253 views
0 votes
1 answer

What is the use of a cursor in SQL Server?

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

answered Sep 13, 2022 in Database by narikkadan
• 63,600 points
771 views
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

answered Sep 17, 2022 in Database by narikkadan
• 63,600 points
952 views
0 votes
0 answers

What is the definition of cardinality in SQL?

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

Feb 18, 2022 in Database by Neha
• 9,020 points
786 views
0 votes
1 answer
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

answered Jun 24, 2019 in Big Data Hadoop by Gitika
• 65,770 points
1,523 views
0 votes
1 answer

What is an index in SQL?

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

answered Feb 3, 2022 in Database by Vaani
• 7,070 points
678 views
0 votes
1 answer

What is the candidate key in SQL Server?

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

answered Feb 23, 2022 in Database by Neha
• 9,020 points
4,282 views
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

answered Feb 4, 2022 in Database by Neha
• 9,020 points
5,286 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP