All mock tests are FREE till 31 December — register to save your progress
Paper 2 CS · UNIT 04 · MOCK TEST

Mock 8 – Transactions, Concurrency & Recovery

Unit 4: Database Management Systems · 28 questions · about 33 minutes. Press End Mock any time to see your score and the correct answers.

All 11 topic-wise mocks in this unit
0 / 28 answered 00:00
Q1. Match the LIST-I with LIST-II
LIST-ILIST-II
A. Wait-for graphI. Holds all locks until it commits
B. Precedence graphII. Holds write-locks until it commits
C. Rigorous 2PLIII. Use to check deadlocks
D. Strict 2PLIV. Used to check serializability
Choose the correct answer from the options given below:
Q2. Consider the following statements:
A. A non-serial schedule is said to be conflict serializable if it is conflict-equivalent to some serial schedule.
B. A non-serial schedule is said to be view serializable if it is view-equivalent to some serial schedule.
C. A schedule is said to be serial if instructions of participating transactions are chronologically interleaved with each other.
D. A conflict-serializable schedule will be view-serializable also but vice-versa may not be true.
Choose the correct answer from the options given below:
Q3. In concurrency control, the phantom problem may occur when
Q4. Consider the transactions T1, T2, T3 and the schedules S1 and S2 given below.
T1: r1(x); r1(z); w1(z)
T2: r2(y); r2(z); w2(z)
T3: r3(y); r3(x); w3(y)
S1: r1(x); r3(y); r3(x); r2(y); r2(z); w3(y); w2(z); r1(z); w1(x); w1(z)
S2: r1(x); r3(y); r2(y); r3(x); r1(z); r2(z); w3(y); w1(x); w2(z); w1(z)
Which one of the following statements about the schedules is TRUE?
Q5. Which of the following statements are CORRECT?
(A) Granularity is the size of data items in a database.
(B) Two operations in a schedule are said to be in conflict if they belong to the same transaction.
(C) Two schedules are said to be conflict equivalent if the order of any two conflicting operations is the same in both schedules.
(D) Write operations that are performed without performing the write operation are known as blind writes.
Choose the correct answer from the options given below:
Q6. Which of the following scenarios may lead to an irrecoverable error in a database system?
Q7. Which one of the following is NOT a part of the ACID properties of a database transaction?
Q8. Which of the following concurrency-control protocols ensures both conflict serializability and freedom from deadlock?
Statement I: Two-phase locking
Statement II: Timestamp ordering
Q9. Which of the following is/are true in case of tree locking (the tree protocol)?
A. It ensures shorter waiting times.
B. It ensures freedom from deadlock.
C. A transaction can lock data items earlier.
D. It does not ensure a greater amount of concurrency.
Choose the correct answer from the options given below:
Q10. The techniques used to handle the phantom problem are:
A. Time stamping
B. Index locking
C. Predicate locking
D. Execution indexing
Choose the correct answer from the options given below:
Q11. Let T1 be a transaction that transfers Rs. 50 from account A to account B: 1 Read(A); 2 A := A − 50; 3 Write(A); 4 Read(B); 5 B := B + 50; 6 Write(B). What is the status of the database just after the 3rd step but before the 5th step?
Q12. Match List I with List II
List IList II
A. Timestamp protocolI. As long as the transaction is running, it obtains the required locks in the first phase.
B. Strict two-phase locking protocolII. Indicates the final lock of the schedule.
C. Two-phase lockingIII. Ensures freedom from deadlock.
D. Lock point in two-phase locking protocolIV. Ensures cascadeless rollback.
Q13. Consider the schedule S (operations at successive timestamps t1–t6):
t1: T2 R(X), T3 R(Y)
t2: T2 W(X), T3 W(Y)
t3: T1 R(Y), T4 R(X)
t4: T1 W(Y), T4 W(X)
t5: T3 R(X)
t6: T3 W(X)
Choose the correct (conflict-equivalent) serial execution order for the schedule S.
Q14. Consider the following statements:
Statement I: Conservative 2PL is a deadlock-free protocol.
Statement II: Thomas's write rule enforces conflict serializability.
Statement III: The timestamp ordering protocol ensures serializability based on the order of transaction timestamps.
Which of the following is correct?
Q15. What is called journaling in a Linux operating system?
Q16.

In concurrency control, phantom problem may occur, when-

Q17.

Consider transactions T1: r1(x); r1(z); w1(z) T2: r2(y); r2(z); w2(z) T3: r3(y); r3(x); w3(y), and schedules S1: r1(x); r3(y); r3(x); r2(y); r2(z); w3(y); w2(z); r1(z); w1(x); w1(z) and S2: r1(x); r3(y); r2(y); r3(x); r1(z); r2(z); w3(y); w1(x); w2(z); w1(z). Which statement is TRUE?

Q18.

Which of the following scenario may lead to an irrecoverable error in a database system?

Q19.

Given below are two statements: Which of the following concurrency control protocol ensures both conflict serializability and freedom from deadlock?

Statement I: Two phase locking

Statement II: Timestamp ordering In the light of the above statements, choose the most appropriate answer from the options given below:

Q20.

Let T1 transfer ₹50 from account A to account B: 1 Read(A); 2 A := A − 50; 3 Write(A); 4 Read(B); 5 B := B + 50; 6 Write(B). What is the state of the database just after step 3 but before step 5?

Q21.

Match List I with List II

Figure
Q22.

Consider the schedule S: t1: R2(X), R3(Y); t2: W2(X), W3(Y); t3: R1(Y), R4(X); t4: W1(Y), W4(X); t5: R3(X); t6: W3(X). Choose the correct serial execution order equivalent to S.

Q23.

Statement I: Conservative 2PL is a deadlock-free protocol. Statement II: Thomas's write rule enforces conflict serializability. Statement III: Timestamp ordering ensures serializability based on the order of transaction timestamps. Which is correct?

Q24.

A transaction may be in one of the following states during its execution life cycle in concurrent execution environment.

A. FAILED

B. TERMINATED

C. PARTIALLY COMMITTED

D. COMMITTED

E. ACTIVE Given a transaction in active state during its execution, find its next transitioned state from the options given below:

Q25.

In the context of concurrency control, a given pair of operations in a schedule is called conflict schedule if

(A) At least one of the operations is write operation.

(B) Both the operations are performed on the same data item.

(C) Both the operations are performed by different transactions.

(D) Both the operations are performed on different data items.

Q26.

Two concurrent executing transactions 1 and T 2 are allowed to update same stock item say ' A ' in an uncontrolled manner. In such scenario, following problems may occur :

(a) Dirty read problem

(b) Lost update problem

(c) Transaction failure

(d) Inconsistent database state Which of the following option is correct if database system has no concurrency module and allows concurrent execution of above two transactions?

Q27.

Consider two transactions on account A (initial balance 20,000): T1 transfers 5,000 to account B, then T2 applies 10% interest to A. The log is:

(i) T1 start

(ii) T1, A, old = 20,000, new = 15,000

(iii) T1, B, old = 12,000, new = 17,000

(iv) T1 commit

(v) T2 start

(vi) T2, A, old = 15,000, new = 16,500 (vii) T2 commit Suppose the database crashes just before log record (vii) is written. When the system restarts, which statement is true of the recovery process?

Q28.

Consider the following schedules involving two transactions: S₁: r₁(X); r₁(Y); r₂(X); r₂(Y); w₂(Y); w₁(X) S₂: r₁(X); r₂(X); r₂(Y); w₂(Y); r₁(Y); w₁(X) Which one of the following statements is correct?