QUESTION 1 OF 10

What does atomicity mean in database transactions?

Reveal the answer and explore the explanation.

01
EasyCore

What does atomicity mean in database transactions?

Answer
Answer

All operations in a transaction commit as a unit or none take effect after rollback.

Practical example

Save a test attempt and related updates together.

SQLRelated concept example
BEGIN;
UPDATE study_progress SET completed = true
WHERE user_id = $1 AND topic_slug = $2;
COMMIT;

Bind both parameters in the application, enforce ownership, and roll back on failure.

Reference: Further reading ↗

Last 30 min revisionHigh-yield interview Q&As