A transaction is a logical unit of work that maintains the ACID properties of atomicity, consistency, isolation, and durability. It can consist of one or more SQL commands or portions of an application program. Transactions must be atomic, leaving the database in a consistent state whether the transaction commits or aborts. Isolation ensures that transactions appear to execute sequentially and do not affect each other. The database system guarantees durability so committed transactions survive system failures or restarts.