Oracle Database SQL — Question 111
Which two are true about using the FOR UPDATE clause in a SELECT statement? (Choose two.)
Answer options
- A. It can be used with SET operators (UNION, INTERSECT etc.).
- B. It cannot be used with the DISTINCT keyword.
- C. If the NOWAIT clause is added, the statement will automatically acquire locks from their owning transactions and not wait.
- D. The statement skips rows locked by other transactions.
- E. It can be used with joins.
Correct answer: B, E
Explanation
Option B is correct because the FOR UPDATE clause cannot be used with the DISTINCT keyword due to the nature of locking rows. Option E is also correct as the FOR UPDATE clause can indeed be used with joins to lock the relevant rows. The other options are incorrect as they either misrepresent the behavior of the clause or state conditions that are not applicable.