Type Of Key

Primary Key

A Primary key is a table attribute or column that identify every record present in a table uniquely.

There can be only one primary key attribute in a table and primary key column elements can't be same or Null values.


Super Key

It is the set of all columns which help to identify rows in a table uniquely.


Candidate key

A candidate key is a column or a set of columns that can qualify as a primary key in the database. There can be multiple candidate keys in a table and only one candidate key can qualify as the primary key.


Composite Key

It is a set of two or more attributes that helps to identify each tuple in a table uniquely. Any key such as super, primary, or candidate key etc. can be called composite key if it has more than one attributes.


Foreign Key

A foreign key is a key used to link two tables together. This is sometimes also called as a referencing key.