Primary Key versus Unique Constraint?

前端 未结 16 1919
轮回少年
轮回少年 2020-12-13 03:49

I\'m currently designing a brand new database. In school, we always learned to put a primary key in each table.

I read a lot of articles/discussions/newsgroups posts

16条回答
  •  眼角桃花
    2020-12-13 04:27

    posts saying that it's better to use unique constraint (aka unique index for some db) instead of PK

    i guess that the only point here is the same old discussion "natural vs surrogate keys", because unique indexes and pk´s are the same thing.

    translating:

    posts saying that it's better to use natural key instead of surrogate key

提交回复
热议问题