- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Candidate Key in RDBMS
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.