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.
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_ID | ##Student Registration | ##Student NameStudent_Email | ##S02 |
4545 | Dave | ddd@gmail.com | S34 |
4541 | Jack | jjj@gmail.com | S22 |
##4555 | Mark | mmm@gmail.com |
Student_Enroll
andStudent_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!