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

前端 未结 12 2191
悲&欢浪女
悲&欢浪女 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

    This is typically called a surrogate key and it has many benefits. One of which is insulating your database relationships from the application data. More details and the corresponding disadvantages can be found at the wiki link provided above.

提交回复
热议问题