Primary Key vs Unique key
Both unique. PK: one per table, NOT NULL, clustered in InnoDB. UNIQUE: many allowed, NULL handling differs, secondary index.
id INT PRIMARY KEY, email VARCHAR UNIQUE is the classic pair.
Trap — two PRIMARY KEYs. Impossible. Two UNIQUE keys. Fine.
On the example next to this theory: Primary Key vs Unique key — keys and constraints protect data integrity; indexes speed lookups.
students.id ← PK (unique)
▲
│ FK
marks.student_idExam tip
One PK. Many UNIQUE (email, phone).