Key plays an important role in relational database; it is used for identifying unique rows from table. It also establishes relationship among tables.
Types of keys in DBMS
Note: Guys I have been getting comments that there are no examples of keys here. If you click on the hyperlink provided below in green colour, you would see the complete separate tutorial of each key with examples.
Primary Key – A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that table.
Super Key – A super key is a set of one of more columns (attributes) to uniquely identify rows in a table.
Candidate Key – A super key with no redundant attribute is known as candidate key
Alternate Key – Out of all candidate keys, only one gets selected as primary key, remaining keys are known as alternate or secondary keys.
Composite Key – A key that consists of more than one attribute to uniquely identify rows (also known as records & tuples) in a table is called composite key.
Foreign Key – Foreign keys are the columns of a table that points to the primary key of another table. They act as a cross-reference between tables.
Kgotso says
It would really be helpful if there were examples for all the keys using one table to demonstrate them
Scott says
You can reach the examples of each by clicking either the hyperlinks on the left or the ones in the web page itself.
Taslim Arif says
if u would have clicked on any of key u might have seen all the details mate.