A candidate key is an attribute (or set of attributes) that can uniquely identify each tuple in a table.
Explanation:
- A table can have multiple candidate keys.
- The Primary Key is chosen from the candidate keys.
- Candidate keys must be unique and not null.
Example:
For a Students table:
| student_id | name | |
|---|---|---|
| 101 | alice@email.com | Alice |
Here, student_id and email are candidate keys, as both uniquely identify a student.
Leave a Reply