Show Indexes
SHOW INDEX FROM students; lists indexes, columns, uniqueness, cardinality. Key_name PRIMARY is the PK.
EXPLAIN still answers ‘will this query use it?’. SHOW INDEX answers ‘what exists?’.
Trap — looking at cardinality 2 on a boolean and expecting miracles.
On the example next to this theory: Show Indexes: create two demo rows, then SELECT qty >= 2 ordered. Say which labels come back.
Exam tip
SHOW INDEX FROM students;