Definition of Key, Super key, Candidate key, Primary key

Key: Key is a unique identification of entity.

Super key: A super key may contain additional attributes that are not necessary fir unique identification.

Candidate key: A candidate key is a super key such that no proper subset is a superkey within the relation, put simply a candidate key is a minimal(Dividing a super key to get more unique super key) superkey.
No repeatation of any attributes.

Primary key: An attribute or combination of attributes that uniquely identifies one and only one instance of an entity is called a primary key or identifier.

Example: Std(ID, Name, Address, Email)
Super key- (ID), (ID, Name), (Name, Address), (Email)
Candidate key: (ID), (Name, Address), (Email)
Primary key: (ID)

From the above example we can say, Every Primary key is Candidate key and Super key but every Candidate key & Super key is not Primary key. Again every Candidate key is Super key but every Super key is not Candidate key.

Comments

Popular Posts