O'Reilly logo

SQL: Visual QuickStart Guide, Third Edition by Chris Fehily

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 14. Transactions

A transaction is a sequence of one or more SQL statements executed as a single logical unit of work. The DBMS considers a transaction to be an indivisible, all-or-nothing proposition: It executes all the transaction’s statements as a group, or it executes none of them.

Canonical law requires me to illustrate the importance of transactions with a banking example. Suppose that a customer transfers $500 from her savings account to her checking account. This operation consists of two separate actions, executed sequentially:

  1. Decrement savings balance by $500.

  2. Increment checking balance by $500.

Figure 14.1 shows the two SQL statements for this transaction. Now imagine that the DBMS fails—power outage, system crash, hardware problem—after ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required