What is the difference b/w Primary Key and Unique Key

前端 未结 11 1984
孤城傲影
孤城傲影 2020-12-24 13:07

I tried to find it out in google but not satisfactory answer is given out there. Can anybody explain the solid difference.

actually if Primary key is used to sele

11条回答
  •  感动是毒
    2020-12-24 13:25

    Just to add another example:

    Think of a table holding user data, where each user has an email address. No two users can have the same email address, so that column becomes a unique key. While it could be the primary key (I have never made a string a primary key), it doesn't have to be.

提交回复
热议问题