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 despite concurrent execution. The database system guarantees transaction durability even in the event of failures.