A transaction is a logical unit of work that contains one or more SQL statements. It begins with the first executable SQL statement and ends either when committed or rolled back. Changes are permanent after a commit, while a rollback undoes all changes. Transactions provide atomicity, consistency, isolation, and durability (ACID) properties to maintain data integrity when multiple users access and change data simultaneously.