Consider the following transaction involving two bank accounts and .
read(x); x:=x-50; write (x); read(y); y:=y+50; write(y)
The constraint that the sum of the accounts and should remain constant is that of
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 () 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 constant is an integrity constraint, it falls under the Consistency property.
Free practice · Your answers on this page are not saved.
