Primary Key
PRIMARY KEY uniquely identifies each row. students.roll or an AUTO_INCREMENT id. Not NULL. Only one PRIMARY KEY per table (it may be two columns together — composite).
InnoDB uses the PK as the clustered index — rows are stored in PK order. A stable integer PK is a good default. Don’t use a name as PK (people change names).
INSERT duplicate PK → error 1062. Foreign keys from other tables point at this PK.
Trap: table with no PK. Trap: VARCHAR UUID PK on a huge table without thinking about InnoDB clustering (advanced, but worth a line if asked).
On the example next to this theory — Primary Key — keys and constraints protect data integrity; indexes speed lookups.
students.id ← PK (unique)
▲
│ FK
marks.student_idroll INT PRIMARY KEY or id INT PRIMARY KEY AUTO_INCREMENT.