What Is The Different Between Primary Key And Unique Key? - Save My Knowledge
Tuesday, February 7, 2017

What Is The Different Between Primary Key And Unique Key?

Hi, when we are creating field database that used for code or something that can be identifier, we are facing with 2 constraint options: Primary key and Unique key. What should we choose between them? It might be tough to choose between those 2 if we don't understand what is the use between those 2.
Alright I will make it quick, Primary Key and Unique Key is same, they are not allow to have 2 same value, the different is Primary Key won't allow the field to be empty, but Unique Key are allowed to have empty field.
So if you need identifier that like ID Card, you should use Primary Key because everybody need to have id card, but if you need something for Driving License Card, you should use Unique Key, because no everybody have driving license.

Hope this helpful 😊