Transactions and concurrency control (original) (raw)
**Consider the following transactions with data items P and Q initialized to zero:
T1: read (P) ;
read (Q) ;
if P = 0 then Q : = Q + 1 ;
write (Q) ;
T2: read (Q) ;
read (P) ;
if Q = 0 then P : = P + 1 ;
write (P) ;
**Any non-serial interleaving of T1 and T2 for concurrent execution leads to
- A schedule that is not conflict serializable
- A conflict serializable schedule
- A schedule for which a precedence graph cannot be drawn
Consider the following schedule for transactions T1, T2 and T3:

Which one of the schedules below is the correct serialization of the above?
Let us assume that transaction T1 has arrived before transaction T2. Consider the schedule
S=r1(A); r2(B) ; w2(A); w1(B)
Which of the following is true?
- Allowed under basic timestamp protocol.
- Not allowed under basic timestamp protocols because T1 is rolled back
- Not allowed under basic timestamp protocols because T2 is rolled back
Which of the following concurrency control protocol ensures both conflict serializability and free from deadlock?
Which one of these is characteristic of RAID 5?
Consider following schedules involving two transactions: S1 : r1(X); r1(Y); r2(X); r2(Y); w2(Y); w1(X) S2 : r1(X); r2(X); r2(Y); w2(Y); r1(Y); w1(X) Which of the following statement is true?
- Both S1 and S2 are conflict serializable.
- S1 is conflict serializable and S2 is not conflict serializable.
- S1 is not conflict serializable and S2 is conflict serializable.
- Both S1 and S2 are not conflict serializable.
Consider the following relation:
Works (emp_name, company_name, salary)
Here, emp_name is primary key. Consider the following SQL query
Select emp_name From works T where salary > (select avg (salary) from works S where T.company _ name = S.company _ name)
The above query is for following :
- Find the highest paid employee who earns more than the average salary of all employees of his company.
- Find the highest paid employee who earns more than the average salary of all the employees of all the companies.
- Find all employees who earn more than the average salary of all employees of all the companies.
- Find all employees who earn more than the average salary of all employees of their company.
Consider the following log sequence of two transactions on a bank account, with initial balance 12000, that transfer 2000 to a mortgage payment and then apply a 5% interest. 1. T1 start 2. T1 B old=1200 new=10000 3. T1 M old=0 new=2000 4. T1 commit 5. T2 start 6. T2 B old=10000 new=10500 7. T2 commit Suppose the database system crashes just before log record 7 is written. When the system is restarted, which one statement is true of the recovery procedure?
- We must redo log record 6 to set B to 10500
- We must undo log record 6 to set B to 10000 and then redo log records 2 and 3
- We need not redo log records 2 and 3 because transaction T1 has committed
- We can apply redo and undo operations in arbitrary order because they are idempotent.
Consider the table R with attributes A, B and C. The functional dependencies that hold on R are : A → B, C → AB. Which of the following statements is/are True ? I. The decomposition of R into R1(C, A) and R2(A, B) is lossless. II. The decomposition of R into R1(A, B) and R2(B, C) is lossy.
Consider a schedule S generated by the basic Timestamp Ordering (TO) protocol. Which of the following statements is CORRECT regarding the recoverability and cascading rollback anomalies in S?
****(GATE 2012 | MCQ | 1-Mark)**
- The basic Timestamp Ordering protocol guarantees that all generated schedules are strictly recoverable
- The basic Timestamp Ordering protocol guarantees conflict serializability and freedom from cascading rollbacks
- The basic Timestamp Ordering protocol guarantees conflict serializability, but the schedules may suffer from cascading rollbacks
- The basic Timestamp Ordering protocol does not guarantee conflict serializability but ensures clean recoverability
There are 48 questions to complete.
Take a part in the ongoing discussion