Why use an auto-incrementing primary key when other unique fields exist?

前端 未结 12 2291
悲&欢浪女
悲&欢浪女 2021-01-30 10:36

I\'m taking a course called \"database systems\" and for our class project I have to design a website.

Here\'s an example of a table I created:

CREATE TA         


        
12条回答
  •  独厮守ぢ
    2021-01-30 11:06

    we use ID to prevent duplication data and it can make some procces become not complicated (if we want to update or delete data), it more simple if we use ID.

    if you dont want to use ID you can use another fields. but dont forget to make them become UNIQUE. it can make your data become preventive from duplication data.

    another way outside PRIMARY is UNIQUE.

提交回复
热议问题