1Z0-873 · Question #13
You want to lock the three tables a, b and c, and issue the following statements: mysql> LOCK TABLES a READ; mysql> LOCK TABLES b READ; mysql> LOCK TABLES c READ; Which tables are now locked?
The correct answer is C. Table c only. If you need to use multiple tables while holding an explicit lock, you must lock all of them at the same time because you cannot use any unlocked tables while you hold explicit locks. Also, you must lock all the tables with a single LOCK TABLES statement. LOCK TABLES releases…
Question
You want to lock the three tables a, b and c, and issue the following statements:
mysql> LOCK TABLES a READ; mysql> LOCK TABLES b READ; mysql> LOCK TABLES c READ; Which tables are now locked?
Options
- ATables a, b and c
- BTable a only
- CTable c only
- DNone of the tables are locked
How the community answered
(50 responses)- A4% (2)
- B10% (5)
- C80% (40)
- D6% (3)
Explanation
If you need to use multiple tables while holding an explicit lock, you must lock all of them at the same time because you cannot use any unlocked tables while you hold explicit locks. Also, you must lock all the tables with a single LOCK TABLES statement. LOCK TABLES releases any locks that you already hold, so you cannot issue it multiple times to acquire multiple locks.
Topics
Community Discussion
No community discussion yet for this question.