Skip to content
Official PYQ · 2015

GATE CS 2015 Set 2 Q1 — Transactions and Concurrency Control

Explain with AI

Consider the following transaction involving two bank accounts xx and yy.

  read(x); x:=x-50; write (x); read(y); y:=y+50; write(y)

The constraint that the sum of the accounts xx and yy should remain constant is that of 

Choose one option
View worked solution

Answer: B

The correct option is B.

This question tests the understanding of the ACID properties of database transactions:

  • Consistency: This property ensures that a transaction brings the database from one valid state to another, maintaining all predefined rules and integrity constraints. In this scenario, the sum of the account balances (x+yx + y) must remain constant before and after the transaction. This is a classic application-defined consistency constraint.
  • Atomicity: Ensures that either all operations of the transaction are completed successfully, or none are (all-or-nothing).
  • Isolation: Ensures that the concurrent execution of transactions results in a state equivalent to if they were executed serially.
  • Durability: Ensures that once a transaction is committed, its updates survive even in the event of a system crash.

Since maintaining the total sum x+yx + y constant is an integrity constraint, it falls under the Consistency property.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Transactions and Concurrency Control questions