CS Atlas GATE 2027
DBMS course
0 / 119 complete

DBMS/Phase 6 · Transactions & Concurrency

Chapter review LI-6.1-6.3 · Item 99 of 119

Chapters 6.1–6.3 Lock-in

Read at your own pace. Try the questions before opening the answers.

On this page

A · Compressed recap

A transaction is one logical unit of work (reads, writes, then commit or abort). ACID: atomicity and durability by the recovery manager (undo, redo), isolation by concurrency control, consistency by the programmer. States: active → partially committed → committed; failed → aborted.

Uncontrolled interleaving gives lost updates (R1 R2 W1 W2), dirty reads (reading uncommitted data), unrepeatable reads, phantoms. SQL levels: RU < RC (no dirty) < RR (no unrepeatable) < SERIALIZABLE (no phantom). A schedule keeps each transaction's order; n! serial schedules; total (Σnᵢ)!/Πnᵢ!.

B · Merged rule card

6.1.1 Transaction basics: read/write, commit/abort, ACID, transaction states

  • Transaction = one logical unit of work: read(X), write(X), ending in commit or abort.
  • Atomicity (recovery: undo), Consistency (programmer + constraints), Isolation (concurrency control), Durability (recovery: redo).
  • States: active → partially committed → committed; active/partially committed → failed → aborted; committed/aborted = terminated.

6.2.1 Concurrency problems: lost update, dirty read, unrepeatable read, phantom

  • Lost update: R1(X) R2(X) W1(X) W2(X).
  • Dirty read: read uncommitted data (W1 R2 … A1).
  • Unrepeatable read: R1(X) W2(X) C2 R1(X).
  • Phantom: re-run query sees inserted/deleted rows; needs predicate/range locks.
  • Isolation levels: RU allows dirty; RC stops dirty; RR stops unrepeatable; SERIALIZABLE stops phantoms.

6.3.1 Schedules: serial vs concurrent; counting possible schedules

  • Schedule: interleaving that keeps each transaction's order; complete = all end in C/A.
  • Serial schedules: n! for n transactions.
  • Total schedules: (Σnᵢ)! / Πnᵢ!; non-serial = total − n!.

C · Interleaved GATE-style questions

Q1 · MCQ · 1 mark(s) — ACID

Rolling back an incomplete transaction after a crash preserves:

  1. (A) Consistency only
  2. (B) Atomicity
  3. (C) Durability
  4. (D) Isolation

Q2 · MCQ · 1 mark(s) — States

Which transition is impossible?

  1. (A) Committed → Aborted
  2. (B) Partially committed → Failed
  3. (C) Active → Failed
  4. (D) Failed → Aborted

Q3 · NAT · 2 mark(s) — Lost update

X = 40. T1: R(X), X × 3, W(X). T2: R(X), X + 10, W(X). Schedule R2(X) R1(X) W2(X) W1(X). Final X?

Numerical answer: ________

Q4 · MCQ · 1 mark(s) — Anomaly

Which anomaly can REPEATABLE READ still show?

  1. (A) Dirty read
  2. (B) None
  3. (C) Phantom
  4. (D) Unrepeatable read

Q5 · NAT · 2 mark(s) — Counting

T1 has 3 operations, T2 has 2 and T3 has 2. How many schedules?

Numerical answer: ________

Q6 · NAT · 1 mark(s) — Serial

T1, T2, T3: how many serial schedules?

Numerical answer: ________

Q7 · MSQ · 2 mark(s) — Anomalies

Which schedules contain a dirty read (a read of a value written by a transaction that has not yet committed)?

  1. (A) W2(B) R1(B) A2 C1
  2. (B) W1(A) R2(A) C1 C2
  3. (C) R1(A) W2(A) C2 R1(A) C1
  4. (D) W1(A) C1 R2(A) C2

Q8 · MCQ · 1 mark(s) — Schedules

In schedule R1(A) R2(A) W2(A) W1(A), which pair is in the wrong order for a valid schedule of T1 = R1(A) W1(A) and T2 = R2(A) W2(A)?

  1. (A) R1(A) before W1(A)
  2. (B) none: the schedule is valid
  3. (C) R2(A) before W2(A)
  4. (D) W2(A) before W1(A)

D · Answer Vault

Reveal answers when you’re ready

Q1 Answer: (B) · 1 mark(s)

All or nothing.

  • (A) is wrong: Not the direct goal.
  • (C) is wrong: About committed data.
  • (D) is wrong: About interference.

Re-read: Lesson 6.1.1 — Transaction basics: read/write, commit/abort, ACID, transaction states

Q2 Answer: (A) · 1 mark(s)

A committed transaction cannot be rolled back.

  • (B) is wrong: Possible.
  • (C) is wrong: Possible.
  • (D) is wrong: Possible.

Re-read: Lesson 6.1.1 — Transaction basics: read/write, commit/abort, ACID, transaction states

Q3 Answer: 120 · 2 mark(s)

Both read 40; T2 writes 50; T1 writes 120.

Re-read: Lesson 6.2.1 — Concurrency problems: lost update, dirty read, unrepeatable read, phantom

Q4 Answer: (C) · 1 mark(s)

Standard table.

  • (A) is wrong: Prevented.
  • (B) is wrong: Phantoms remain.
  • (D) is wrong: Prevented.

Re-read: Lesson 6.2.1 — Concurrency problems: lost update, dirty read, unrepeatable read, phantom

Q5 Answer: 210 · 2 mark(s)

7!/(3!2!2!) = 5040/24.

Re-read: Lesson 6.3.1 — Schedules: serial vs concurrent; counting possible schedules

Q6 Answer: 6 · 1 mark(s)

3!.

Re-read: Lesson 6.3.1 — Schedules: serial vs concurrent; counting possible schedules

Q7 Answer: (A) (B) · 2 mark(s)

A: T2 reads A before T1 commits. D: T1 reads T2's B before T2 aborts.

  • (C) is wrong: That is an unrepeatable read (T2 committed first).
  • (D) is wrong: T1 committed before the read.

Re-read: Lesson 6.2.1 — Concurrency problems: lost update, dirty read, unrepeatable read, phantom

Q8 Answer: (B) · 1 mark(s)

Each transaction's own order is kept; the interleaving is free.

  • (A) is wrong: Correct order.
  • (C) is wrong: Correct order.
  • (D) is wrong: Cross-transaction order is free.

Re-read: Lesson 6.3.1 — Schedules: serial vs concurrent; counting possible schedules

Ready for the next idea?

Mark this item complete when you’ve finished reading and working through it.