0
0
SQLquery~20 mins

ACID properties mental model in SQL - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
ACID Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding Atomicity in Transactions

Which of the following best describes the Atomicity property in database transactions?

AData must remain consistent before and after a transaction.
BAll parts of a transaction must complete successfully; otherwise, none are applied.
COnce a transaction is committed, its changes are permanent even after a crash.
DTransactions must be isolated from each other to prevent interference.
Attempts:
2 left
💡 Hint

Think about whether a transaction can be partially done or not.

🧠 Conceptual
intermediate
2:00remaining
Identifying Isolation in ACID

What does the Isolation property ensure in concurrent database transactions?

ATransactions appear to run one after another, not simultaneously.
BData is saved permanently after commit.
CTransactions must be atomic and indivisible.
DData remains consistent before and after transactions.
Attempts:
2 left
💡 Hint

Think about how transactions behave when multiple users access the database at the same time.

query_result
advanced
2:00remaining
Effect of Durability After Crash

Consider a transaction that updates a bank account balance and commits successfully. The system crashes immediately after commit. What will be the state of the updated balance after recovery?

AThe updated balance will be permanently saved and visible after recovery.
BThe updated balance will be lost and revert to the old value.
CThe balance will be partially updated causing inconsistency.
DThe balance will be locked and inaccessible until manual fix.
Attempts:
2 left
💡 Hint

Think about what durability guarantees after a commit.

🧠 Conceptual
advanced
2:00remaining
Consistency in Database Transactions

Which statement best explains the Consistency property in ACID?

AAll parts of a transaction must succeed or none at all.
BTransactions must be isolated from each other to avoid conflicts.
CTransactions transform the database from one valid state to another, preserving rules.
DChanges made by a transaction are permanent after commit.
Attempts:
2 left
💡 Hint

Think about database rules and constraints before and after a transaction.

🔧 Debug
expert
3:00remaining
Diagnosing Isolation Level Effects

Given two concurrent transactions:
Transaction 1 reads a value, waits, then updates it.
Transaction 2 updates the same value and commits during Transaction 1's wait.
Which isolation level will cause Transaction 1 to see the updated value from Transaction 2 during its read?

ARead Committed
BRepeatable Read
CSerializable
DRead Uncommitted
Attempts:
2 left
💡 Hint

Consider which isolation level allows reading uncommitted or dirty data.