[SOLVED] Why can a database table have only one primary key?

Issue

A database table can only have one primary key not two or more .. why is that so?

Solution

The major reason is because that is the definition of the primary key. A table can have multiple unique keys that identify each row, but only one primary key.

In databases such as MySQL, the primary key is also a clustered index. That provides a more direct reason. The data is sorted on the pages according to the clustered index. A table can only have one sort order.

Answered By – Gordon Linoff

Answer Checked By – David Marino (BugsFixing Volunteer)

Leave a Reply

Your email address will not be published.