<database> A set of related changes applied to a database. The term typically implies that either all of the changes should be applied or, in the event of an error, none of them, i.e. the transaction should be atomic. Atomicity is one of the ACID properties a transaction can have, another is isolation - preventing interference between processes trying to access the database cocurrently. This is usually achieved by some form of locking - where one process takes exclusive control of a database table or row for the duration of the transaction, preventing other processes from accessing the locked data.
The canonical example of a transaction is transferring money between two bank accounts by subtracting it from one and adding it to the other.
Some relational database management systems require the user to explicitly start a transaction and then either commit it (if all the individual steps are successful) or roll it back (if there are any errors).