Which statements are true regarding the FOR UPDATE clause in a SELECT statement? (Choose all
that apply.)
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.
Option E is also correct
Select for update holds the records “for your changes only” so someone else cannot update or delete records but is possible to query rows.
You can’t perform any DML operations until commit or rollback is given.
xaclty, but in E is mentioned only about query.
can we able to use where clause in the select statement which has FOR UPDATE clause?
yes, you can use.
Then Opt B is correct right?
yes, it is correct.
E is also correct answer.
i need reason why choose ‘e’ doesn’t considered as a answer?
Because it says that no other query can access the same rows until the transaction is either committed or rolled back, and that is not true.
select for update prevents changes to be made by other transactions, but they can still see the data as it was at the time of the select for update execution
so option e is also in answer
No ‘e’ is not an answer. please see noel’s reply everyone..
Indeed, “E” is wrong. The Locked rows can be accessed by other users (but not updated, deleted)