Home>Article>Database> Candidate keys in RDBMS

Candidate keys in RDBMS

王林
王林 forward
2023-08-27 22:05:02 1325browse

RDBMS 中的候选键

Each table has only one primary key. Each relationship may have one or more candidate keys. One of these candidate keys is called the primary key. Every candidate key is eligible to become a primary key. Therefore the candidate primary key is called candidate key.

The candidate key can be a single column or a combination of multiple columns. The smallest superkey is called a candidate key.

Example

EmployeeIDandEmployeeEmail, both can be primary keys; therefore both are candidate keys. Choose any one as the primary key of the table because a table can have only one primary key.

Let’s see another example -

##Student Name Student_Email ##S02 S34 S22 ## above, Student_ID,
Student_ID

##Student Registration

4545

Dave

ddd@gmail.com

4541

Jack

jjj@gmail.com

##4555

Mark

mmm@gmail.com

Student_Enroll

and

Student_Emailare candidate keys. They are considered candidate keys because they uniquely identify student records.

The above is the detailed content of Candidate keys in RDBMS. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete