What is the difference between a primary key and a unique key?
- A A primary key cannot contain NULL and there is only one per table; unique keys allow one NULL and can be multiple
- B They are identical
- C A unique key cannot contain NULL
- D A primary key allows duplicate values
Answer
A primary key cannot contain NULL and there is only one per table; unique keys allow one NULL and can be multiple
Both enforce uniqueness, but a table has exactly one primary key which is also the clustered index in InnoDB, while it may have many unique keys.





