ACID properties in DBMS​

ACID is a set of four essential properties that ensure a database transaction is safe, reliable, and accurate.

A transaction means:

A small unit of work that changes data in a database.
Example: Money transfer, bill payment, ATM withdrawal, deposit, login attempt record, etc.


🔥 ACID = Atomicity + Consistency + Isolation + Durability


⭐ 1. Atomicity

Meaning:

  • The transaction must happen completely or not at all.
  • “All or Nothing Rule.”

Key points:

  • No half-completed work is allowed.
  • If one step fails → entire transaction is cancelled.
  • Database returns to original state.

Example (Banking):

You transfer ₹500 from A to B. A transaction has two steps:

  1. Deduct ₹500 from A
  2. Add ₹500 to B

If Step 2 fails due to network issue → Step 1 is also undone.
So A’s balance stays the same.
No money disappears.
No partial update.


⭐ 2. Consistency

Meaning:

  • The transaction must move the database from one valid state to another valid state.
  • Data should always follow rules/constraints.

Key points:

  • Ensures database rules are not violated.
  • Guarantees data correctness.
  • Ensures integrity constraints (like NOT NULL, UNIQUE, FOREIGN KEY) are not broken.

Example (Banking):

  • Account balance cannot be negative.
  • Interest rate cannot be > 100%.
  • PAN number must be unique.

If a transaction tries to violate rules → it will be rejected.

✔ Maintains accuracy and validity.
✔ Protects business rules.


⭐ 3. Isolation

Meaning:

  • Every transaction should work independently.
  • One transaction should not affect another while running.

Key points:

  • No interference between transactions.
  • Ensures parallel transactions give correct results.
  • Prevents problems like:
    • Dirty reads
    • Lost updates
    • Uncommitted data access

Example (Banking):

Transaction 1: A withdrawing ₹1000 from ATM.
Transaction 2: A checking account balance on mobile app.

Both happen at the same time.
Isolation ensures the balance shown is correct, without mixing intermediate steps.

✔ Each transaction acts as if it is running alone.


⭐ 4. Durability

Meaning:

  • Once a transaction is successfully completed, the data must be permanently saved.
  • Even if:
    • System crashes
    • Power goes off
    • Server restarts

Key points:

  • Uses logs, backups, and storage techniques.
  • Ensures committed data is never lost.

Example (Banking):

You transfer ₹5,000 to someone.
App shows “Transaction Successful”.
Even if:

  • ATM loses power
  • Mobile app crashes
  • Bank server restarts

The transaction will still be recorded in your account statement.

✔ Committed = Permanent.
✔ No loss of confirmed data.


🧠 Quick Memory Table

PropertySimple MeaningKey IdeaBanking Example
AtomicityAll or noneNo partial updateMoney transfer must fully succeed or fail
ConsistencyValid stateNo rule violationCannot have negative balance
IsolationSeparate transactionsNo interferenceATM withdrawal & balance check
DurabilityPermanent resultsData persistsTransaction stays after crash

📝 One-Line Definitions

  • Atomicity: A transaction is executed completely or not at all.
  • Consistency: Transaction maintains database rules and integrity.
  • Isolation: Transactions run independently without affecting each other.
  • Durability: Committed data is permanently stored even after failures.

ACID PROPERTIES


🔶 SECTION A: BASIC DEFINITIONS

1. ACID stands for:

A. Atomicity, Consistency, Isolation, Durability
B. Accuracy, Consistency, Integrity, Durability
C. Atomicity, Concurrency, Integrity, Durability
D. Accuracy, Concurrency, Isolation, Data
Answer: A

2. ACID properties are used in:

A. Operating systems
B. DBMS & RDBMS
C. Internet Browsers
D. Compilers
Answer: B

3. ACID ensures:

A. Secure network
B. Reliable transactions
C. Fast response
D. Hardware safety
Answer: B


🔶 SECTION B: ATOMICITY

4. Atomicity ensures:

A. Transaction is partially done
B. Transaction is fully done or not done at all
C. Transaction happens twice
D. Data is encrypted
Answer: B

5. Atomicity is also known as the:

A. Integrity rule
B. Lock rule
C. All-or-nothing rule
D. Consistency rule
Answer: C

6. If a transaction fails in the middle, Atomicity:

A. Deletes the database
B. Undoes all completed steps
C. Saves half the steps
D. Commits partial data
Answer: B

7. In a money transfer, Atomicity ensures that:

A. Only debit happens
B. Only credit happens
C. Both debit and credit happen together
D. None
Answer: C


🔶 SECTION C: CONSISTENCY

8. Consistency ensures database moves from:

A. Valid state to invalid state
B. One valid state to another valid state
C. Invalid to valid only
D. Any state to any state
Answer: B

9. Consistency prevents:

A. Power failure
B. Violation of rules/constraints
C. Network lag
D. File corruption
Answer: B

10. Which of the following may violate Consistency?

A. Primary key duplication
B. Negative account balance
C. Foreign key mismatch
D. All of the above
Answer: D

11. Which ACID property is related to “Integrity Constraints”?

A. Atomicity
B. Consistency
C. Isolation
D. Durability
Answer: B


🔶 SECTION D: ISOLATION

12. Isolation ensures:

A. No data is saved
B. Transactions do not affect each other
C. Data is permanently stored
D. No constraints
Answer: B

13. Isolation is used to avoid:

A. Deadlock
B. Conflict in concurrent transactions
C. Power failure
D. Data deletion
Answer: B

14. Which issue occurs if Isolation is not maintained?

A. Dirty read
B. Lost update
C. Uncommitted read
D. All of the above
Answer: D

15. ATM withdrawal and online balance check require which property?

A. Consistency
B. Isolation
C. Atomicity
D. Durability
Answer: B


🔶 SECTION E: DURABILITY

16. Durability ensures:

A. Data is temporary
B. Data is stored permanently after commit
C. Only half data is stored
D. Data is rolled back automatically
Answer: B

17. Durability protects data from:

A. Power failure
B. System crash
C. Errors
D. All of these
Answer: D

18. Durability depends on:

A. Logs & backups
B. RAM only
C. Internet speed
D. Query language
Answer: A

19. In Durability, committed data will stay even if:

A. App crashes
B. System restarts
C. Power goes off
D. All of the above
Answer: D


🔶 SECTION F: MIXED

20. Which ACID property prevents “partial updates”?

A. Consistency
B. Atomicity
C. Durability
D. Isolation
Answer: B

21. Which ACID property deals with “correctness of data”?

A. Isolation
B. Durability
C. Consistency
D. Atomicity
Answer: C

22. Which ACID property is most related to “concurrency control”?

A. Durability
B. Isolation
C. Atomicity
D. Consistency
Answer: B

23. Commit operation finalizes which property?

A. Durability
B. Isolation
C. Atomicity
D. Consistency
Answer: A

24. Rollback operation is part of:

A. Durability
B. Atomicity
C. Encryption
D. Backup
Answer: B


🔶 SECTION G:

25. Which two properties ensure reliable multi-user transactions?

A. Durability + Consistency
B. Isolation + Atomicity
C. Isolation + Durability
D. Atomicity + Consistency
Answer: C

26. Which ACID property prevents data corruption during system crash?

A. Durability
B. Atomicity
C. Isolation
D. Integrity
Answer: A

27. Violating Consistency may break:

A. Referential integrity
B. Entity integrity
C. Domain integrity
D. All
Answer: D

28. Which property ensures “no dirty read”?

A. Atomicity
B. Isolation
C. Consistency
D. Durability
Answer: B


🔶 SECTION H:

29. Atomicity means partial update is allowed.

True / False
Answer: False

30. Consistency ensures rules are maintained.

True / False
Answer: True

31. Isolation prevents interference between transactions.

True / False
Answer: True

32. Durability ensures committed data is lost on crash.

True / False
Answer: False


🔶 SECTION I: APPLICATION-BASED

33. A bank transfer succeeds but system crashes after commit. Which property ensures that transfer is saved?

A. Atomicity
B. Durability
C. Isolation
D. Consistency
Answer: B

34. Two users withdraw money at the same time. Which property ensures no incorrect balance?

A. Atomicity
B. Isolation
C. Durability
D. Consistency
Answer: B

35. Transaction tries to insert duplicate PAN number. Which property stops it?

A. Consistency
B. Durability
C. Atomicity
D. Isolation
Answer: A

36. If one step of a transaction fails, the whole transaction is cancelled. Which property?

A. Durability
B. Isolation
C. Consistency
D. Atomicity
Answer: D


🔶 SECTION J: ADVANCED/DIFFICULT

37. Which property uses logs and checkpoints internally?

A. Atomicity
B. Durability
C. Isolation
D. Consistency
Answer: B

38. Dirty read occurs when:

A. Transaction reads uncommitted data
B. Database crashes
C. Constraint is violated
D. Two transactions run serially
Answer: A

39. Which property prevents dirty read?

A. Durability
B. Consistency
C. Isolation
D. Atomicity
Answer: C

40. The “serializability” concept is part of:

A. Durability
B. Atomicity
C. Isolation
D. Consistency
Answer: C


🔶 SECTION K:

41. Which ACID property ensures database remains error-free after rollback?

A. Isolation
B. Durability
C. Consistency
D. Atomicity
Answer: C

42. Which property ensures that the effects of completed transactions persist?

A. Atomicity
B. Consistency
C. Isolation
D. Durability
Answer: D

43. Which combination ensures “database correctness”?

A. Atomicity + Isolation
B. Consistency + Atomicity
C. Durability + Isolation
D. None
Answer: B

44. During crash recovery, the DBMS checks logs to maintain:

A. Durability
B. Isolation
C. Atomicity
D. Consistency
Answer: A


🔶 SECTION L: MORE HIGH-VALUE

45. Which ACID property ensures that the database “never reaches an invalid state”?

A. Atomicity
B. Consistency
C. Isolation
D. Durability
Answer: B

46. Which one is directly related to COMMIT and ROLLBACK operations?

A. Durability
B. Atomicity
C. Isolation
D. Consistency
Answer: B

47. Which property is MOST important in a banking environment?

A. Isolation
B. All of them
C. Consistency
D. Durability
Answer: B