Relational database design question - Surrogate-key or Natural-key?

前端 未结 10 2086
忘了有多久
忘了有多久 2020-11-27 22:33

Which one is the best practice and Why?

a) Type Table, Surrogate/Artificial Key

Foreign key is from user.type to type.i

10条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-27 23:34

    I prefer to use the surrogate key. It is often people will identity and use the natural key which will be fine for a while, until they decide they want to change the value. Then problems start.

提交回复
热议问题