Isolation Levels and the Anomalies They Allow · seed 1 · A4, ink-friendly. The answer key prints on its own page for grown-ups.

Which wrong answers can you afford

Computing · Data & Databases · ages 20-21
Name ______________________   Date ____________
  1. Your range query lists five orders, then six on its rerun, because a new order arrived. Which anomaly is this?

    • A phantom read
    • A dirty read
    • A deadlock
  2. Your transaction reads 100, another commits 80, and your next read gets 80. Which anomaly is this?

    • A dirty read
    • A lost update
    • A non-repeatable read
  3. A dirty read sees data that was never committed.

    Circle one:   True   False

  4. Two transactions interleave to produce a phantom read. Which level would have prevented it?

    • Read committed, which is enough for new rows
    • Read uncommitted, the fastest choice
    • Serializable, the level that forbids phantoms
  5. Which level is the lowest one that forbids dirty reads?

    • Read uncommitted
    • Read committed
    • Read approved
  6. Which workload fits a weaker isolation level, and why?

    • A rough analytics count, because a stale total harms nobody
    • A bank balance, because money is simple
    • A seat booking, because double booking is fine
  7. Pat claims repeatable read also forbids phantoms, since both involve rereading. What is wrong?

    • Nothing, the two anomalies are the same
    • Repeatable read forbids dirty reads only
    • Phantoms are new rows, not changed rows, and need serializable
  8. A booking system runs at read committed and sometimes sells the last seat twice. Which level fixes it, and what does it forbid that the current one permits?

    • Read uncommitted, which is faster and looser
    • Serializable, which forbids the phantom that sneaks the second booking in
    • No level can help, since seats are not rows
LightMySky · lightmysky.comW1-mt_utxPNgxveB-s1

Answer key

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

Which wrong answers can you afford W1-mt_utxPNgxveB-s1

  1. A phantom read · New rows appearing in a repeated range query are phantoms.
  2. A non-repeatable read · The same query inside one transaction gave two different answers.
  3. True · Uncommitted data is exactly what makes the read dirty.
  4. Serializable, the level that forbids phantoms · Only the strongest level in the stack blocks brand-new rows.
  5. Read committed · Read committed is the first level that blocks uncommitted data.
  6. A rough analytics count, because a stale total harms nobody · Loose levels suit reads where small error costs nothing.
  7. Phantoms are new rows, not changed rows, and need serializable · Rereading old rows differs from new rows arriving, and each maps to its own level.
  8. Serializable, which forbids the phantom that sneaks the second booking in · The second booking is a new row the first check never saw.
Worksheet · LightMySky