Candidate Key in RDBMS

RDBMSDatabaseMySQL

Each table has only a single primary key. Each relation may have one or more candidate key. One of these candidate key is called Primary Key. Each candidate key qualifies for Primary Key. Therefore candidates for Primary Key is called Candidate Key.

Candidate key can be a single column or combination of more than one column. A minimal super key is called a candidate key.

Example

EmployeeID and EmployeeEmail, both can be a Primary key; therefore both are candidate keys. Select any of the as Primary Key for your table, since a table can have only a single Primary Key.
Let us see another example −

Student_ID

Student_Enroll

Student_Name

Student_Email

S02
4545
Dave
ddd@gmail.com
S34
4541
Jack
jjj@gmail.com
S22
4555
Mark
mmm@gmail.com


Above, Student_ID, Student_Enroll and Student_Email are the candidate keys. They are considered candidate keys since they can uniquely identify the student record.

raja
Published on 04-Jul-2018 13:26:21
Advertisements