Primary Key versus Unique Constraint?

前端 未结 16 1932
轮回少年
轮回少年 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:23

    I was thinking of this problem my self. If you are using unique, you will hurt the 2. NF. According to this every non-pk-attribute has to be depending on the PK. The pair of attributes in this unique constraint are to be considered as part of the PK.

    sorry for replying to this 7 years later but didn't want to start a new discussion.

提交回复
热议问题