What is key?
Key is the attribute or set of attribute which uniquely identify the tuple(row).
what is SuperKey?
-Every kind of key is called as superkey(set of attribute which uniquely identify the tuple).
Candidate key:
Minimal superkey is called as candidate key.
-There is also possible that there is more than one candidate key a table have.
Primary key:
Primary key is the one candidate key which is chosen by administration of the table.
-Table depend on the primary key.
-Primary key can't be NULL.
-Primary key do not have duplicate data.
Alternate key:
Candidate key which is not the primary key is called Alternate key.
Unique key:
It is key in which all record are unique.
-Null possible may be possible.
Foreign key:
-It is the key which refer the primary key of another table.
-Used to establish the relation between the tables.
Subordinate key:
Candidate key which is not the primary key is called Subordinate key.