Can a database table be without a primary key?

前端 未结 11 553
谎友^
谎友^ 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:14

    I run into the same question on one of the tables i did.

    The problem was that the PK was supposed to be composed out of all the rows of the table all is well but this means that the table size will grow very fast with each row inserted.

    I choose to not have a PK, but only have an index on the row i do the lookup on.

提交回复
热议问题