What is the difference between a candidate key and a primary key?

后端 未结 11 1214
不思量自难忘°
不思量自难忘° 2020-12-23 17:24

Is it that a primary key is the selected candidate key chosen for a given table?

11条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-23 18:08

    Think of a table of vehicles with an integer Primary Key.

    The registration number would be a candidate key.

    In the real world registration numbers are subject change so it depends somewhat on the circumstances what might qualify as a candidate key.

提交回复
热议问题