217k views
0 votes
Transaction is an action or series of actions the execution of which should lead to a consistent database state from another consistent database state. Discuss which properties that transactions should have for their correct executions. Provide two examples to support your answer.

User Vgru
by
4.1k points

1 Answer

5 votes

Step-by-step explanation:

A transaction is a very small system unit that can contain many low-level tasks. A transaction in a database system should maintain, Atomicity, Consistency, Isolation, and Durability − these are commonly known as ACID properties − in order to ensure accuracy, completeness, and integrity of the data.

An example of a simple transaction is as below, Suppose a bank employee transfers Rs 500 from A's account to B's account.

A’s Account

Open_Account(A)

Old_Balance = A.balance

New_Balance = Old_Balance - 500

A.balance = New_Balance

Close_Account(A)

B’s Account

Open_Account(B)

Old_Balance = B.balance

New_Balance = Old_Balance + 500

B.balance = New_Balance

Close_Account(B)

User StLia
by
4.7k points