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

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

    If the username is the primary key and a user changes his/her username, you will need to update all the tables which have foreign key references to the users table.

提交回复
热议问题