Posted By: Anonymous
I’m using mysql database. I have a confusion between primary key and unique key.
Please help me where should I create primary and unique key. I mean in which situation we create unique key or primary key .
- There can only be one primary key in a table
- In some DBMS it cannot be
NULL– e.g. MySQL adds
- Primary Key is a unique key identifier of the record
- Can be more than one unique key in one table
- Unique key can have
- It can be a candidate key
- Unique key can be
NULL; multiple rows can have
NULLvalues and therefore may not be considered “unique”