Oracle Database 12c: SQL Fundamentals — Question 57
Which statements are true regarding the FOR UPDATE clause in a SELECT statement? (Choose all that apply.)
Answer options
- A. It locks only the columns specified in the SELECT list.
- B. It locks the rows that satisfy the condition in the SELECT statement.
- C. It can be used only in SELECT statements that are based on a single table.
- D. It can be used in SELECT statements that are based on a single or multiple tables.
- E. After it is enforced by a SELECT statement, no other query can access the same rows until a COMMIT or ROLLBACK is issued.
Correct answer: B, D
Explanation
The correct answers are B and D. Statement B is accurate because the FOR UPDATE clause locks the specific rows returned by the SELECT statement. Statement D is also correct since the clause can indeed be used with queries that involve multiple tables, contrary to statement C which is incorrect as it limits usage to single table queries.