Can a database table be without a primary key?

前端 未结 11 573
谎友^
谎友^ 2021-01-31 14:39

Can anyone tell me if a table in a relational database (such as MySQL / SQL SERVER) can be without a primary key?

For example, I could have table day_temperature

11条回答
  •  佛祖请我去吃肉
    2021-01-31 15:32

    I would include a surrogate/auto-increment key, especially if there is any possibility of duplicate time/temperature readings. You would have no other way to uniquely identify a duplicate row.

提交回复
热议问题