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

后端 未结 11 1206
不思量自难忘°
不思量自难忘° 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 17:48

    Candidate Key – A Candidate Key can be any column or a combination of columns that can qualify as unique key in database. There can be multiple Candidate Keys in one table. Each Candidate Key can qualify as Primary Key.

    Primary Key – A Primary Key is a column or a combination of columns that uniquely identify a record. Only one Candidate Key can be Primary Key.

    More on this link with example

提交回复
热议问题