Transactions & ACID · SQL SQL

What is the primary purpose of the Write-Ahead Logging (WAL) protocol in database transaction management?

Practice question from Transactions & ACID (SQL SQL), with the correct answer and a step-by-step solution.

medium · MCQ · Q-D0092A

What is the primary purpose of the Write-Ahead Logging (WAL) protocol in database transaction management?

  1. A.To index table columns automatically before a write operation occurs.
  2. B.To guarantee Atomicity and Durability by ensuring changes are logged to persistent storage before data pages are written.Correct answer
  3. C.To prevent deadlocks by serializing all incoming transactions.
  4. D.To compress historical table rows for archiving purposes.

Solution

Write-Ahead Logging ensures that modification logs are flushed to disk before the actual database pages are updated, allowing the database to recover uncommitted or committed changes during crash recovery.

More from Transactions & ACID

All of Transactions & ACID

Practise more SQL

Sign up free for adaptive practice on this chapter, with instant feedback and hints on every question.

Start practising free

Free to start · No credit card needed