35.2k views
1 vote
Define the terms candidate key and primary key. Explain the difference between a primary key and a candidate key.

1 Answer

3 votes

Step-by-step explanation:

Both Primary Key and Candidate Key are the attributes that are used to access tuples from a table. These (Primary key and Candidate key) are also can be used to create a relationship between two tables.

  • A Candidate Key can be any column or a combination of columns that can qualify as a unique key in the database. Each Candidate Key can qualify as a Primary Key.
  • A Primary Key is a column or a combination of columns that uniquely identify a record. The primary key is a minimal super key, so there is one and only one primary key in any relationship.

The main difference between them is that a primary key is unique but there can be many candidate keys.

I hope you find this information useful and interesting! Good luck!

User Cephas
by
7.8k points