Differentiate between Candidate Key and Primary Key in the context of Relational Database Model.
Advertisements
Question
Differentiate between Candidate Key and Primary Key in the context of Relational Database Model.
Distinguish Between
Advertisements
Solution
| S. No. | Basis | Primary Key | Candidate Key |
| 1. | Uniqueness | A record in a table can be uniquely identified by its primary key, which is a non-null and unique key. There can only be one main key in a table. | Although a table may have more than one candidate key, a candidate key is also a unique key to identify a record in a table. |
| 2. | Null value | The value of the primary key column cannot be null. | The value of a candidate key column may be null. |
| 3. | Objective | The primary key is the most crucial component of every table or relationship. | A candidate key indicates which key is suitable for use as the primary key. |
| 4. | Relation | A candidate key is the primary key. | A candidate key could be a primary key or not. |
shaalaa.com
Is there an error in this question or solution?
