Glossary · Database

Transaction

A sequence of database operations that are treated as a single logical unit–either all succeed or all are rolled back.

A database transaction is a logical unit of work consisting of one or more operations (reads, inserts, updates, deletes) that are executed as an indivisible whole. Transactions follow ACID properties: they are Atomic (all-or-nothing), Consistent (maintain data integrity), Isolated (concurrent transactions don't interfere), and Durable (committed changes persist). Transactions begin with BEGIN or START TRANSACTION, and end with COMMIT (save changes) or ROLLBACK (undo changes). Savepoints allow partial rollbacks within a transaction. Transaction isolation levels (Read Uncommitted, Read Committed, Repeatable Read, Serializable) control how concurrent transactions interact, balancing consistency against performance.

In practice

How AI for Database applies it

AI for Database generates read-only queries by default, ensuring your data is never accidentally modified during analysis.
Database · aifordatabase glossaryRead-only ✓

Fig — every answer ships with the tables, rows and SQL behind it.

Related terms

See it on your own database

Connect read-only in minutes. Free models included.

Start free