Section: IT & Technology · DatabasesDifficulty: Medium

SQL Transaction

USUK

A sequence of SQL operations treated as a single atomic unit that either all succeed or all fail.

Definition

An SQL transaction is a sequence of one or more database operations (INSERT, UPDATE, DELETE, SELECT) that are executed as a single logical unit of work governed by ACID properties. Transactions begin with BEGIN (or START TRANSACTION), end with COMMIT (to make changes permanent) or ROLLBACK (to undo all changes). The isolation level (READ UNCOMMITTED through SERIALIZABLE) controls visibility of concurrent transactions' changes. Transactions are fundamental for maintaining data integrity in concurrent database environments.

Example

A bank transfer transaction deducts $500 from Account A and credits $500 to Account B; if the credit fails for any reason, the entire transaction rolls back, ensuring Account A is never debited without Account B being credited.

Synonyms

  • database transaction
  • atomic operation
  • ACID transaction

Antonyms / Opposites

  • non-transactional operation
  • rollback

Images

CC-licensed · free to use
More on Wikimedia
Loading images…

Video

  • acid
  • sql
  • normalization
  • replication

Dictionary Entry

Back to IT & Technology