Should each and every table have a primary key?

后端 未结 15 1013
甜味超标
甜味超标 2020-11-22 07:00

I\'m creating a database table and I don\'t have a logical primary key assigned to it. So, I\'m thinking about leaving it without a primary key, but I\'m feeling a bit guilt

15条回答
  •  遥遥无期
    2020-11-22 07:26

    Always best to have a primary key. This way it meets first normal form and allows you to continue along the database normalization path.

    As stated by others, there are some reasons not to have a primary key, but most will not be harmed if there is a primary key

提交回复
热议问题