Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Tests  >  Database Management System (DBMS)  >  Test: Transactions & Concurrency Control- 3 - Computer Science Engineering (CSE) MCQ

Test: Transactions & Concurrency Control- 3 - Computer Science Engineering (CSE) MCQ


Test Description

10 Questions MCQ Test Database Management System (DBMS) - Test: Transactions & Concurrency Control- 3

Test: Transactions & Concurrency Control- 3 for Computer Science Engineering (CSE) 2024 is part of Database Management System (DBMS) preparation. The Test: Transactions & Concurrency Control- 3 questions and answers have been prepared according to the Computer Science Engineering (CSE) exam syllabus.The Test: Transactions & Concurrency Control- 3 MCQs are made for Computer Science Engineering (CSE) 2024 Exam. Find important definitions, questions, notes, meanings, examples, exercises, MCQs and online tests for Test: Transactions & Concurrency Control- 3 below.
Solutions of Test: Transactions & Concurrency Control- 3 questions in English are available as part of our Database Management System (DBMS) for Computer Science Engineering (CSE) & Test: Transactions & Concurrency Control- 3 solutions in Hindi for Database Management System (DBMS) course. Download more important topics, notes, lectures and mock test series for Computer Science Engineering (CSE) Exam by signing up for free. Attempt Test: Transactions & Concurrency Control- 3 | 10 questions in 30 minutes | Mock test for Computer Science Engineering (CSE) preparation | Free important questions MCQ to study Database Management System (DBMS) for Computer Science Engineering (CSE) Exam | Download free PDF with solutions
Test: Transactions & Concurrency Control- 3 - Question 1

Consider the following schedule for transactions T1, T2 and T3:

Which one of the schedules below is the correct serialization of the above?

Detailed Solution for Test: Transactions & Concurrency Control- 3 - Question 1

T1 can complete before T2 and T3 as there is no conflict between Write(X) of T1 and the operations in T2 and T3 which occur before Write(X) of T1 in the above diagram.
T3 should can complete before T2 as the Read(Y) of T3 doesn’t conflict with Read(Y) of T2. Similarly, Write(X) of T3 doesn’t conflict with Read(Y) and Write(Y) operations of T2.
Another way to solve this question is to create a dependency graph and topologically sort the dependency graph. After topologically sorting, we can see the sequence T1, T3, T2.

Test: Transactions & Concurrency Control- 3 - Question 2

Consider the following schedule S of transactions T1, T2, T3, T4:

Which one of the following statements is CORRECT?

Detailed Solution for Test: Transactions & Concurrency Control- 3 - Question 2

To check for conflict-serializable, we need to make a precedence graph, if the graph contains a cycle, then it\'s not conflict serializable, else it is. Here, for the precedence graph there will be only two directed edges, one from T2 -> T3 ( Read- Write Conflict), and another from T2 -> T1( Read- Write Conflict), hence no cycle, so the schedule is conflict serializable. Now to check for Recoverable, we need to check for a dirty-read operation( Write by Transaction Ti, followed by Read by Transaction Tj but before Ti commits) between any pair of operations. If no dirty-read then recoverable schedule, if a dirty read is there then we need to check for commit operations. Here no dirty read operation ( as T3 and T1 commits before T4 reads the Write(X) of T3 and T1 , and T2 commits before T4 reads the Write(Y) of T2 ). Therefore the schedule is recoverable. Hence, Option C.

1 Crore+ students have signed up on EduRev. Have you? Download the App
Test: Transactions & Concurrency Control- 3 - Question 3

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=12000 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?

Detailed Solution for Test: Transactions & Concurrency Control- 3 - Question 3

We must undo log record 6 to set B to 10000 and then redo log records 2 and 3 bcoz system fail before commit operation. So we need to undone active transactions(T2) and redo committed transactions (T1) Note: Here we are not using checkpoints. Checkpoint : Checkpoint is a mechanism where all the previous logs are removed from the system and stored permanently in a storage disk. Checkpoint declares a point before which the DBMS was in consistent state, and all the transactions were committed. Recovery: When a system with concurrent transactions crashes and recovers, it behaves in the following manner − =>The recovery system reads the logs backwards from the end to the last checkpoint. =>It maintains two lists, an undo-list and a redo-list. =>If the recovery system sees a log with and or just , it puts the transaction in the redo-list. =>If the recovery system sees a log with but no commit or abort log found, it puts the transaction in undo-list. All the transactions in the undo-list are then undone and their logs are removed. All the transactions in the redo-list and their previous logs are removed and then redone before saving their logs. So Answer is B redo log records 2 and 3 and undo log record 6

Test: Transactions & Concurrency Control- 3 - Question 4

Consider three data items D1, D2 and D3 and the following execution schedule of transactions T1, T2 and T3. In the diagram, R(D) and W(D) denote the actions reading and writing the data item D respectively.

Which of the following statements is correct?

Detailed Solution for Test: Transactions & Concurrency Control- 3 - Question 4

T1 and T2 have conflicting operations between them forming a cycle in the precedence graph. R(D2) of T2, and W(D2) of T1 ( Read-Write Conflict) R(D1) of T1, and W(D1) of T2 ( Read-Write Conflict) Hence in the precedence graph of the schedule there would be a cycle between T1 and T2 vertices. Therefore not a serializable schedule.

Test: Transactions & Concurrency Control- 3 - Question 5

Consider the following transaction involving two bank accounts x and y.
read(x);  x := x – 50;  write(x);  read(y);  y := y + 50;  write(y) 
The constraint that the sum of the accounts x and y should remain constant is that of

Detailed Solution for Test: Transactions & Concurrency Control- 3 - Question 5

Consistency in database systems refers to the requirement that any given database transaction must only change affected data in allowed ways, that is sum of x and y must not change.

Test: Transactions & Concurrency Control- 3 - Question 6

Consider the following four schedules due to three transactions (indicated by the subscript) using read and write on a data item x, denoted by r(x) and w(x) respectively. Which one of them is conflict serializable.

Detailed Solution for Test: Transactions & Concurrency Control- 3 - Question 6

In option D, there is no interleaving of operations. The option D has first all operations of transaction 2, then 3 and finally 1 There can not be any conflict as it is a serial schedule with sequence 2 --> 3 -- > 1

Test: Transactions & Concurrency Control- 3 - Question 7

Consider the transactions T1, T2, and T3 and the schedules S1 and S2 given below.
T1: r1(X); r1(Z); w1(X); 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) 

Detailed Solution for Test: Transactions & Concurrency Control- 3 - Question 7

For conflict serializability of a schedule( which gives same effect as a serial schedule ) we should check for conflict operations, which are Read-Write, Write-Read and Write-Write between each pair of transactions, and based on those conflicts we make a precedence graph, if the graph contains a cycle, it\'s not a conflict serializable schedule. To make a precedence graph: if Read(X) in Ti followed by Write(X) in Tj ( hence a conflict ), then we draw an edge from Ti to Tj ( Ti -> Tj) If we make a precedence graph for S1 and S2 , we would get directed edges for S1 as T2->T1, T2->T3, T3->T1, and for S2 as T2->T1, T2->T3, T3->T1, T1->T2. In S1 there is no cycle, but S2 has a cycle. Hence only S1 is conflict serializable. Note : The serial order for S1 is T2 -> T3 -> T1.

Test: Transactions & Concurrency Control- 3 - Question 8

Consider the given schedule and choose the suitable option.
S = T1:R(x), T1:R(y), T1:W(x), T2:R(y), T3:W(y), T1:W(x), T2:R(y) 

Detailed Solution for Test: Transactions & Concurrency Control- 3 - Question 8

Since there is cycle found in precedence graph, it is not Conflict Serializable. Also, there is a blind write in T3 so we need to test further for view serializability using polygraph. From polygraph, we can derive that it is View serializable. Option (C) is Correct.

Test: Transactions & Concurrency Control- 3 - Question 9

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

Detailed Solution for Test: Transactions & Concurrency Control- 3 - Question 9

Option C is a normal operation. Option B is also fine as no write operation is involved. Option A can be recovered, but option D can\'t be. See this for an example.

Test: Transactions & Concurrency Control- 3 - Question 10

Consider a simple checkpointing protocol and the following set of operations in the log.
(start, T4); (write, T4, y, 2, 3); (start, T1); (commit, T4); (write, T1, z, 5, 7); (checkpoint);
(start, T2); (write, T2, x, 1, 9); (commit, T2); (start, T3); (write, T3, z, 7, 2); 
If a crash happens now and the system tries to recover using both undo and redo operations, what are the contents of the undo list and the redo list

Detailed Solution for Test: Transactions & Concurrency Control- 3 - Question 10

Since T1 and T3 are not committed yet, they must be undone. The transaction T2 must be redone because it is after the latest checkpoint.

62 videos|66 docs|35 tests
Information about Test: Transactions & Concurrency Control- 3 Page
In this test you can find the Exam questions for Test: Transactions & Concurrency Control- 3 solved & explained in the simplest way possible. Besides giving Questions and answers for Test: Transactions & Concurrency Control- 3, EduRev gives you an ample number of Online tests for practice

Top Courses for Computer Science Engineering (CSE)

Download as PDF

Top Courses for Computer Science Engineering (CSE)