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 in Database by Vaani
• 5,040 points
84 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 by Neha
• 6,260 points

Related Questions In Database

0 votes
1 answer

What is the SQL query to get the third highest salary of an employee from employee_table

You can try out something like this: SELECT ...READ MORE

answered Sep 27, 2018 in Database by Sahiti
• 6,360 points
7,051 views
0 votes
1 answer

What is the syntax of USE statement in MySQL?

The USE statement is used to mention ...READ MORE

answered Nov 27, 2018 in Database by Sahiti
• 6,360 points
274 views
0 votes
1 answer

what is the syntax of OR statement in MySQL?

The OR operator displays those records which ...READ MORE

answered Dec 1, 2018 in Database by Sahiti
• 6,360 points
197 views
0 votes
1 answer

What are the different types of join in SQL?

Hi Suraj, You have a doubt regarding inner join ...READ MORE

answered May 28, 2019 in Database by sampriti
• 1,120 points
633 views
0 votes
0 answers

What is the definition of cardinality in SQL?

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

Feb 18 in Database by Neha
• 6,260 points
74 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,850 points
282 views
0 votes
1 answer

What is an index in SQL?

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

answered Feb 3 in Database by Vaani
• 5,040 points
29 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 in Database by Neha
• 6,260 points
16 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 in Database by Neha
• 6,260 points
200 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP