Define the term:
i) Candidate key
ii) ii) Primary key
Of course. Here are the definitions for Candidate Key and Primary Key, explained with their properties and a clear example.
Definition:
A Candidate Key is an attribute (a single column) or a set of attributes (multiple columns combined) that can uniquely identify every row (or record) in a table.
A table can have multiple Candidate Keys. For an attribute or set of attributes to qualify as a Candidate Key, it must satisfy two essential properties:
Think of Candidate Keys as "candidates" for the role of the main identifier of the table.
Definition:
A Primary Key is the one Candidate Key that is chosen by the database designer to be the main and official identifier for the rows in a table. It is the key used to uniquely identify each record and establish relationships with other tables.
While a table can have several Candidate Keys, it can have only one Primary Key.
In addition to the properties of a Candidate Key (Uniqueness and Minimality), a Primary Key has one extra, strict rule:
Let's consider a simple Students
table:
| StudentID | SSN | Email | FirstName | LastName |
| :--- | :--- | :--- | :--- | :--- |
|