Exercises

Database Transactions and Concurrency Control

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.

  • 15 Questions
  • Difficulty: Medium
  • Topic: Databases

0/15 answered

  1. 1

    Which ACID property ensures that a transaction's operations either all succeed or all have their effects undone?

  2. 2

    In the illustrated schedule, T2 reads a value written by T1 before T1 aborts. Which anomaly has T2 experienced?

    Question 2
  3. 3

    A transaction reads the same row twice and obtains different committed values because another transaction updated the row between the reads. What occurred?

  4. 4

    The image shows the same range query returning an additional qualifying row after another transaction commits an insert. Which anomaly is illustrated?

    Question 4
  5. 5

    Which isolation level is intended to make concurrent transactions behave as though they executed one at a time in some serial order?

  6. 6

    Under basic two-phase locking, what distinguishes the growing phase from the shrinking phase?

  7. 7

    The wait-for graph contains T1 waiting for T2, T2 waiting for T3, and T3 waiting for T1. What does this cycle indicate?

    Question 7
  8. 8

    Resource R currently has a shared lock held by T1. As illustrated, T2 requests an exclusive lock on R. What should the lock manager do?

    Question 8
  9. 9

    Both transactions in the illustrated schedule read X=100, then T1 writes X=110 and T2 writes X=120 based on its earlier read. Which anomaly occurs?

    Question 9
  10. 10

    A row has version V1 with balance 100 valid from timestamp 10 until 20, and V2 with balance 150 valid from timestamp 20 onward. Which balance is visible to a transaction whose MVCC snapshot timestamp is 15?

    Question 10
  11. 11

    What normally happens during the validation phase of optimistic concurrency control?

  12. 12

    Which rule characterizes strict two-phase locking?

  13. 13

    According to write-ahead logging, what must occur before a modified database page is written to persistent storage?

  14. 14

    What is the primary purpose of a savepoint inside a transaction?

  15. 15

    In the illustrated schedule, T2 reads a value written by T1 and commits before T1 later aborts. Which scheduling requirement is violated?

    Question 15

Download the App now to have access to + 5000 free courses, exercises, certificates and lots of content without paying anything!

  • 100% free online courses from start to finish

    Thousands of online courses in video, ebooks and audiobooks.

  • More than 60 thousand free exercises

    To test your knowledge during online courses

  • Valid free Digital Certificate with QR Code

    Generated directly from your cell phone's photo gallery and sent to your email

Cursa app on the ebook screen, the video course screen and the course exercises screen, plus the course completion certificate