Unique Index
CREATE UNIQUE INDEX idx_email ON students(email); is UNIQUE constraint + index. Inserting the same email twice fails. Search by email is fast.
Same idea as UNIQUE KEY in CREATE TABLE. Pick one style.
Trap — UNIQUE index on a column that can legally repeat.
On the example next to this theory — Unique Index — keys and constraints protect data integrity; indexes speed lookups.
Exam tip
CREATE UNIQUE INDEX idx_email ON students(email);