Alternate Key in DBMS

Alternate key in DBMS 

 

In this article, we will learn about the Alternate Key in DBMS.

Sometimes more than one column is having the capability to uniquely identify a row but they might not be selected as primary keys this type of keys on nothing but alternate keys.

Definition of alternate key 

Alternate keys  are  columns present in the table which are not selected as primary keys but still, they have all the capabilities to be used as a primary key is called alternate key.

Alternate Key in DBMS

Examples for an alternate key

Example if a table student contain four columns

[ID,NAME,PHONE,AGE ]

Consider the following table student 

IDNAMEPHONEAGE
66John783297347723
67Judy973286746421
68John892382647625
69Mike732624784423

 

  • Among these four columns ID  is used as a primary key because no two  students will have the same Id and capable of uniquely accessing a student record in the table
  • In the same way phone attribute, no two  students will have same phone numberHence  phone column is an alternate key  because it is not been selected as a primary key, even if it is having the capability to be selected as a primary key