Transactions and the ACID Promise · seed 1 · A4, ink-friendly. The answer key prints on its own page for grown-ups.

Four promises that let database code stay simple

Computing · Data & Databases · ages 19-21
Name ______________________   Date ____________
  1. A rule says balances never drop below zero. Which promise guards it?

    • Durability
    • Consistency
    • Isolation
  2. Power fails halfway through moving money between accounts. What does atomicity do?

    • Makes sure either both legs happen or neither does
    • Doubles the money for safety
    • Keeps the half move
  3. Two friends edit one shared record at once, each seeing a clean copy until the other finishes. Which promise?

    • Durability
    • Atomicity
    • Isolation
  4. A server crashes right after a commit. What happens to the committed transfer?

    • It is lost with the crash
    • It survives through the database log
    • It repeats twice
  5. Which sequence must be one transaction?

    • Debit one account plus credit the other
    • Two unrelated balance reads
    • A log note plus a font change
  6. Rollback can undo a confirmation message already sent to a customer.

    Circle one:   True   False

  7. A programmer wraps each single read in its own transaction and calls it safer. What is the error?

    • The bundle buys nothing there; group steps that must stand together
    • Transactions slow down reads to zero
    • Single reads need bigger bundles
  8. A transfer debits account A, then crashes before crediting B, with no transaction used. What is left behind?

    • A doubled balance
    • A clean valid state
    • A broken state with money missing
LightMySky · lightmysky.comW1-mt_8Egjmafq-L-s1

Answer key

For grown-ups. Fold this page away before handing over the rest.

Four promises that let database code stay simple W1-mt_8Egjmafq-L-s1

  1. Consistency · Consistency keeps every transaction between valid states.
  2. Makes sure either both legs happen or neither does · All or nothing leaves nothing half done.
  3. Isolation · Running as if alone is isolation.
  4. It survives through the database log · Durability replays the log to bring finished work back.
  5. Debit one account plus credit the other · The two legs belong together or money appears and vanishes.
  6. False · Rollback only reaches work still inside the unfinished transaction.
  7. The bundle buys nothing there; group steps that must stand together · Transactions guard groups with a shared fate, not lone reads.
  8. A broken state with money missing · Without the bundle, the half update stands and rules break.
Worksheet · LightMySky