SQL Interview
Questions and answers on Database Transactions
1)What is a database transaction?
Database transaction take database from one consistent state to
another. At the end of the transaction the system must be in the prior state if
transaction fails or the status of the system should reflect the successful
completion if the transaction goes through.
2) What are properties of a transaction?
Properties of the transaction can be summarized as ACID Properties.
Properties of the transaction can be summarized as ACID Properties.
1. Atomicity
A transaction consists of many steps. When all the steps in a
transaction gets completed, it will get reflected in DB or if any step fails,
all the transactions are rolled back.
2. Consistency
The database will move from one consistent state to another, if
the transaction succeeds and remain in the original state, if the transaction
fails.
3. Isolation
Every transaction should operate as if it is the only
transaction in the system
4. Durability
Once a transaction has completed successfully, the updated
rows/records must be available for all other transactions on a permanent basis
No comments:
Post a Comment