Table Locking
LOCK TABLES students WRITE; stops others from writing that table until UNLOCK TABLES; This is old-school. InnoDB row locks inside transactions are the normal way: START TRANSACTION; UPDATE …; COMMIT;
READ lock lets others read. WRITE lock is exclusive. Easy to deadlock a lab if you forget UNLOCK.
Trap — LOCK TABLES as the answer for every concurrency question. Prefer transactions + InnoDB.
On the example next to this theory: Table Locking: create two demo rows, then SELECT qty >= 2 ordered. Say which labels come back.
Exam tip
Know LOCK TABLES exists. Prefer START TRANSACTION for InnoDB.