All for Joomla All for Webmasters


Alternate key is a secondary key it can be simple to understand by an example:

Let?s take an example of student it can contain NAME, ROLL NO., ID and CLASS.

Here ROLL NO. is primary key and rest of all columns like NAME, ID and CLASS are alternate key.

If a table has more than one candidate key, one of them will become the primary key and rest of all are called alternate keys.

In simple words, you can say that any of the candidate key which is not part of primary key is called an alternate key. So when we talk about alternate key, the column may not be primary key but still it is a unique key in the column.

“An alternate key is just a candidate key that has not been selected as the primary key.”

submit to reddit

Leave a Reply