Exercises
Explore how database systems preserve correctness when multiple transactions run concurrently. This quiz covers ACID properties, isolation levels, dirty reads, phantom rows, lost updates, two-phase locking, deadlocks, multiversion concurrency control, optimistic concurrency, write-ahead logging, savepoints, and recoverable schedules. Questions range from foundational concepts to practical schedule analysis.
Answer the questions below and check the explanation for each answer.
0/15 answered
Auto audio on: the next questions will be read aloud when you click Continue.
Atomicity treats a transaction as one indivisible unit. If any operation fails, the database rolls back the transaction rather than retaining partial changes.
A dirty read occurs when a transaction reads another transaction's uncommitted data. Because T1 later aborts, T2 read a value that never became permanent.
This is a non-repeatable read: rereading the same row returns a different value after another transaction commits an update to it.
A phantom read occurs when repeating a predicate-based query returns a changed set of rows because another transaction inserted or deleted qualifying records.
Serializable provides the strongest standard isolation semantics. Its outcome must be equivalent to some serial execution of the committed transactions.
In two-phase locking, a transaction acquires locks during its growing phase. Once it releases its first lock, it enters the shrinking phase and may not acquire new locks.
A cycle in a wait-for graph means each transaction in the cycle is waiting for another. None can proceed without intervention, so the system has detected a deadlock.
Shared and exclusive locks on the same resource are incompatible when held by different transactions. T2 must wait until T1 releases its shared lock.
This is a lost update. T2 calculates its value from stale data and overwrites T1's committed change, so T1's update is no longer reflected in X.
The snapshot time 15 falls within V1's validity interval, from 10 up to 20. V2 did not yet exist for that snapshot, so the visible balance is 100.
Optimistic control allows work to proceed with little or no locking, then validates the transaction before commit. A detected conflict can cause the transaction to restart or abort.
Strict two-phase locking retains exclusive locks until commit or abort. This prevents other transactions from reading or overwriting uncommitted writes and avoids cascading aborts.
Write-ahead logging requires the relevant log record to reach stable storage before the changed data page. Recovery can then use the log to redo or undo changes after a failure.
A savepoint marks an intermediate position within a transaction. The transaction can roll back work performed after that point without necessarily undoing all earlier work.
A recoverable schedule requires T2 to delay its commit until the transaction whose value it read has committed. Here T2 commits first, so T1's later abort leaves no safe way to roll back T2.

Free CourseSQL Database Programming
4h28m
24 exercises

Free CourseLearn to use Google BigQuery for Beginners
1h17m
14 exercises

Free CourseDatabase Systems: SQL, Indexing, Query Optimization, Transactions and Distributed Databases
33h54m
23 exercises

Free CourseProgramming Databases
1h14m
7 exercises

Free CourseMongoDB Database
1h27m
10 exercises

Free CourseDatabase Management Systems
5h21m
27 exercises

Free CourseDatabase Systems
4h32m
44 exercises

Free CourseMongoDB Tutorial for Beginners
1h39m
14 exercises
Thousands of online courses in video, ebooks and audiobooks.
To test your knowledge during online courses
Generated directly from your cell phone's photo gallery and sent to your email
Download our app via QR Code or the links below:.
+ 10 million
students
Free and Valid
Certificate
60 thousand free
exercises
4.8/5 rating in
app stores
Free courses in
video and ebooks