Question 41
MediumT1 counts orders over ₹5,000 twice in the same transaction and gets 12, then 13, because T2 inserted a new order in between. What is this?
- A.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
DBMS
T1 counts orders over ₹5,000 twice in the same transaction and gets 12, then 13, because T2 inserted a new order in between. What is this?
A phantom read
Deadlock
A dirty read
A lost update
Sign up free to see the answer and a step-by-step explanation.
Which is the lowest isolation level that prevents dirty reads?
SERIALIZABLE
REPEATABLE READ
READ COMMITTED
READ UNCOMMITTED
Sign up free to see the answer and a step-by-step explanation.
Which isolation level (in the SQL standard) still allows phantom reads but prevents non-repeatable reads?
SERIALIZABLE
READ UNCOMMITTED
REPEATABLE READ
READ COMMITTED
Sign up free to see the answer and a step-by-step explanation.
A transaction has executed its last statement but has not yet committed. Which state is it in?
Failed
Aborted
Committed
Partially committed
Sign up free to see the answer and a step-by-step explanation.
In a SQL transaction, what does ROLLBACK TO SAVEPOINT s1 do?
Commits the work before s1
Undoes only the work done after s1, keeping the transaction open
Deletes savepoint s1 only
Ends the transaction and undoes everything
Sign up free to see the answer and a step-by-step explanation.
Why must log records be written to stable storage before the data pages they describe (write-ahead logging)?
Because data pages are read-only
Because logs are smaller
To save memory
So that after a crash the system can always undo or redo the changes
Sign up free to see the answer and a step-by-step explanation.
Under immediate update with an undo/redo log, which transactions are undone after a crash?
None
Those that started but did not commit before the crash
All transactions
Those that committed
Sign up free to see the answer and a step-by-step explanation.
Under deferred update, why is no undo needed after a crash?
All data is in RAM
The log is never used
Changes are written to the database only after the transaction commits
Transactions never fail
Sign up free to see the answer and a step-by-step explanation.
What is shadow paging?
Writing a log record for each update
Copying the whole database at every commit
Locking every page
Keeping the old page table unchanged and switching to a new one at commit
Sign up free to see the answer and a step-by-step explanation.
A schedule lets T2 read a value written by T1, and T2 commits before T1. Then T1 aborts. What kind of schedule is this?
Serial
Non-recoverable
Cascadeless
Strict
Sign up free to see the answer and a step-by-step explanation.