> For the complete documentation index, see [llms.txt](https://vikram-bajaj.gitbook.io/cs-gy-6083-principles-of-database-systems/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vikram-bajaj.gitbook.io/cs-gy-6083-principles-of-database-systems/main-1/sql/intermediate-sql/transactions.md).

# Transactions

A transaction is a unit of work.

Databases use the concept of **atomic** transactions i.e. “all or none”: either all transactions occur or none occur. This helps ensure consistency.

All transactions get committed by default (one can also use the **commit** command). A transaction can be undone using the **rollback** command.
