A transaction is the logical unit of work when performing database operations. A transaction is created by grouping a sequence of one or more DML statements into a single, all-or-nothing proposition with the following characteristics.
Atomicity— All statements must complete successfully or the entire set is aborted.
Consistency— The statements' net effect is to leave the database in a consistent state.
Isolation— Intermediate statements should not be visible to other transactions.
Durability— When the transaction is complete, the changes are made permanent.
These four characteristics of a transaction are often abbreviated ACID. To ensure the consistency of the data, we need to identify the boundaries of a transaction and the SQL ...