Machine-translated by Google. Questions are authored in English.
Top

Managing Multiuser Databases Questions and Answers

1.

Which one of the following is NOT a part of the ACID properties of database transactions?

Exam Year(s)

GATE CS - 2016,

Answer: D

The one that is not an ACID property is Deadlock-freedom.

ACID stands for Atomicity (a transaction happens completely or not at all), Consistency (it takes the database from one valid state to another), Isolation (concurrent transactions do not see each other's partial effects) and Durability (committed changes survive failures).

Deadlock-freedom is a property of a concurrency-control scheme, not of transactions; two-phase locking, for example, guarantees isolation but can deadlock. Atomicity, Consistency and Isolation are three of the four ACID properties.

Please log in or register to report this question.

2.

Consider the following two phase locking protocol. Suppose a transaction \(T\) accesses (for read or write operations), a certain set of objects \(\{O_{1}, \ldots, O_{k}\}\). This is done in the following manner:

Step 1. \(T\) acquires exclusive locks to \(O_{1}, \ldots, O_{k}\) in increasing order of their addresses.
Step 2. The required operations are performed.
Step 3. All locks are released.

This protocol will

Exam Year(s)

GATE CS - 2016,

Answer: A

The protocol will guarantee serializability and deadlock-freedom.

All locks are acquired before any are released, so the protocol is two-phase locking (in fact conservative, strict 2PL, since everything is released together at the end), and 2PL guarantees conflict serializability.

Every transaction also acquires its locks in the same global order, increasing address. A deadlock needs a cycle of transactions each waiting for a lock another holds, but with a fixed acquisition order a transaction can only wait for a lock on a higher address than any it already holds, so no cycle can form. That gives deadlock-freedom, which rules out the three other options.

Please log in or register to report this question.

3.

A schedule of three database transactions \(T_{1}\), \(T_{2}\), and \(T_{3}\) is shown. \(R_{i}(A)\) and \(W_{i}(A)\) denote read and write of data item \(A\) by transaction \(T_{i}\), \(i = 1,2,3\). The transaction \(T_{1}\) aborts at the end. Which other transaction(s) will be required to be rolled back?

\(R_{1}(X)\ W_{1}(Y)\ R_{2}(X)\ R_{2}(Y)\ R_{3}(Y)\ ABORT(T_{1})\)

Exam Year(s)

GATE CS - 2025,

Answer: C

The transactions to roll back are Both \(T_{2}\) and \(T_{3}\).

\(T_{1}\) writes Y, and then \(T_{2}\) reads Y and \(T_{3}\) reads Y before \(T_{1}\) finishes. Both have read a value written by an uncommitted transaction (a dirty read). When \(T_{1}\) aborts, its write to Y is undone, so the values \(T_{2}\) and \(T_{3}\) read never officially existed and both must be rolled back too: a cascading rollback.

\(T_{2}\)'s read of X does not matter, because \(T_{1}\) only read X and did not write it. Since each of \(T_{2}\) and \(T_{3}\) depends on \(T_{1}\)'s write of Y, 'only one of them' and 'neither' are both wrong.

Please log in or register to report this question.

4.

Suppose a database schedule S involves transactions T1, ..., Tn. Construct the precedence graph of S with vertices representing the transactions and edges representing the conflicts. If S is serializable, which one of the following orderings of the vertices of the precedence graph is guaranteed to yield a serial schedule?

Exam Year(s)

GATE CS - 2016,

Answer: A

A serial schedule is guaranteed by a topological order of the precedence graph.

An edge \(T_{i} \to T_{j}\) means an operation of \(T_{i}\) conflicts with and precedes one of \(T_{j}\), so any equivalent serial schedule must run \(T_{i}\) before \(T_{j}\). A conflict-serializable schedule has an acyclic precedence graph, and a topological order lists every vertex after all its predecessors, respecting every edge.

Depth-first and breadth-first orders need not respect edge directions (a vertex can be visited before one of its predecessors), and transaction indices have nothing to do with the conflict order.

Please log in or register to report this question.

5.

Consider the following database schedule with two transactions, \(T_{1}\) and \(T_{2}\).

\(S = r_{2}(X); r_{1}(X); r_{2}(Y); w_{1}(X); r_{1}(Y); w_{2}(X); a_{1}; a_{2}\)

where \(r_{i}(Z)\) denotes a read operation by transaction \(T_{i}\) on a variable \(Z\), \(w_{i}(Z)\) denotes a write operation by \(T_{i}\) on a variable \(Z\) and \(a_{i}\) denotes an abort by transaction \(T_{i}\).

Which one of the following statements about the above schedule is TRUE?

Exam Year(s)

GATE CS - 2016,

Answer: C

The true statement is S does not have a cascading abort.

A cascading abort happens when one transaction has read a value written by another uncommitted transaction, so aborting the writer forces the reader to abort too. Check the reads in \(S\):

  • \(r_{2}(X)\) and \(r_{1}(X)\) both read X before anyone writes it.
  • \(r_{2}(Y)\) and \(r_{1}(Y)\) read Y, which nobody writes.

No transaction reads uncommitted data (there are no dirty reads), so the abort of \(T_{1}\) forces nothing on \(T_{2}\): no cascade. For the same reason the schedule is not non-recoverable, since non-recoverability requires a dirty read. It is not strict, because \(w_{2}(X)\) overwrites X after \(w_{1}(X)\) while \(T_{1}\) has neither committed nor aborted. The option “recoverable, but has a cascading abort” fails because there is no cascade.

Please log in or register to report this question.

6.

Once the DBMS informs the user that a transaction has been successfully completed, its effect should persist even if the system crashes before all its changes are reflected on disk. This property is called

Exam Year(s)

GATE CS - 2024,

Answer: A

The property is durability.

Durability, the D in ACID, guarantees that once a transaction commits and the user is told so, its effects survive later failures. The DBMS achieves this with a write-ahead log forced to stable storage at commit, so the changes can be redone after a crash even if the data pages had not yet been written.

Atomicity is all-or-nothing execution of a transaction. Consistency means a transaction takes the database from one valid state to another. Isolation means concurrent transactions do not see each other's partial effects. None of these is about surviving a crash after commit.

Please log in or register to report this question.

7.

Consider the database transactions T1 and T2, and data items X and Y. Which of the schedule(s) is/are conflict serializable?

Transaction T1Transaction T2
R1(X)
W1(Y)
R1(X)
W1(X)
COMMIT(T1)
W2(X)
W2(Y)
COMMIT(T2)

Exam Year(s)

GATE CS - 2025,

Answer: B

The conflict serializable schedule is W2(X), R1(X), W2(Y), W1(Y), R1(X), COMMIT(T2), W1(X), COMMIT(T1).

Draw the precedence graph: for each pair of conflicting operations (same item, different transactions, at least one a write), add an edge from the transaction that acts first. The schedule is conflict serializable exactly when the graph has no cycle.

  • This schedule: W2(X) before R1(X) and before W1(X), and W2(Y) before W1(Y). Every edge is T2 → T1, so it is equivalent to the serial order T2, T1.
  • R1(X), W2(X), ... , R1(X): R1(X) before W2(X) gives T1 → T2, and W2(X) before the second R1(X) gives T2 → T1: a cycle.
  • R1(X), W1(Y), W2(X), W2(Y), R1(X), ...: T1 → T2 on X and on Y, but W2(X) before the second R1(X) gives T2 → T1: a cycle.
  • W2(X), R1(X), W1(Y), W2(Y), ...: T2 → T1 on X but W1(Y) before W2(Y) gives T1 → T2: a cycle.

Please log in or register to report this question.

8.

Consider concurrent execution of two transactions \(T1\) and \(T2\) in a DBMS, both of which access a data object \(A\). For these two transactions to not conflict on \(A\), which one of the following statements must be true?

Exam Year(s)

GATE CS - 2026,

Answer: A

The transactions do not conflict only if both T1 and T2 only read A.

Two operations on the same data item conflict when they belong to different transactions and at least one of them is a write. Reads alone can be done in any order with the same result, so two reads never conflict.

Each of the other three cases involves a write: T1 reading and T2 writing gives a read-write conflict, T1 writing and T2 reading a write-read conflict, and both writing a write-write conflict. In all three, swapping the order can change what is read or what value is left in A.

Please log in or register to report this question.

9.

Let \(R_{i}(z)\) and \(W_{i}(z)\) denote read and write operations on a data element \(z\) by a transaction \(T_{i}\), respectively. Consider the schedule S with four transactions.

S: \(R_{4}(x)R_{2}(x)R_{3}(x)R_{1}(y)W_{1}(y)W_{2}(x)W_{3}(y)R_{4}(y)\)

Which one of the following serial schedules is conflict equivalent to S?

Exam Year(s)

GATE CS - 2022,

Answer: A

The conflict equivalent serial schedule is \(T_{1} \to T_{3} \to T_{4} \to T_{2}\).

Two operations conflict when they come from different transactions, touch the same item and at least one is a write. Reading the schedule left to right gives these conflicts:

  • on x: \(R_{4}(x)\) and \(R_{3}(x)\) come before \(W_{2}(x)\), giving \(T_{4} \to T_{2}\) and \(T_{3} \to T_{2}\);
  • on y: \(R_{1}(y)\) and \(W_{1}(y)\) come before \(W_{3}(y)\) and \(R_{4}(y)\), giving \(T_{1} \to T_{3}\) and \(T_{1} \to T_{4}\); and \(W_{3}(y)\) comes before \(R_{4}(y)\), giving \(T_{3} \to T_{4}\).

The precedence graph has no cycle, and its only topological order is \(T_{1}, T_{3}, T_{4}, T_{2}\). The other orders break an edge: \(T_{1} \to T_{4} \to T_{3} \to T_{2}\) puts \(T_{4}\) before \(T_{3}\), \(T_{4} \to T_{1} \to \cdots\) puts \(T_{4}\) before \(T_{1}\), and \(T_{3} \to T_{1} \to \cdots\) puts \(T_{3}\) before \(T_{1}\).

Please log in or register to report this question.

10.

Locks placed by command are implicit locks.

Answer: B

Correct answer: False

Locks placed by command are explicit; implicit locks are those the DBMS places on its own initiative to enforce the isolation level in force. The two terms classify locks by who asked for them, which is a different question from whether the lock is shared or exclusive.

Please log in or register to report this question.

Loading…

Other Subjects

Tags: Managing Multiuser Databases Questions and Answers || Managing Multiuser Databases MCQ Questions and Answers || Managing Multiuser Databases GK Questions and Answers || Managing Multiuser Databases GK MCQ Questions || Managing Multiuser Databases Multiple Choice Questions and Answers || Managing Multiuser Databases GK || GK on Managing Multiuser Databases || Database Questions and Answers || Database MCQ Questions and Answers || Database GK Questions and Answers || GK on Database