Primary Key vs Unique Key
Learn Primary Key vs Unique Key (Keys, MySQL) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.
Introduction Both enforce uniqueness, but they differ in role. A table has one primary key, which can never contain NULL and is the row's identity (and the InnoDB clustered index). A table can have many unique keys, which may allow NULLs and are alternate access paths.