KnowledgeBoat Logo
|

Computer Science

Differentiate between primary key and candidate key in a relation.

SQL Queries

2 Likes

Answer

Primary keyCandidate key
A primary key is a set of one or more attributes/fields which uniquely identifies a tuple/row in a table.A candidate key refers to all the attributes in a relation that are candidates or are capable of becoming a primary key.
There can be only one primary key per table.A table can have multiple candidate keys. Only one of them is chosen as the primary key.

Answered By

1 Like


Related Questions