CodeBlanks Logo Icon CodeBlanks

ACID

Learn the ACID principles.

ACID

ACID is four properties: Atomicity, Consistency, Isolation, Durability. The foundation of reliable transactions.

-- Atomicity: ya hep ya hiç
-- Consistency: geçerli durum
-- Isolation: bağımsız oturum
-- Durability: kalıcı değişiklik

Four ACID properties.

ACID — details

Atomicity means indivisibility, Consistency coherence, Isolation independence, Durability permanence.

For example, a committed order isn't lost even if the server shuts down right after; that is the durability principle.

Practice ACID

Write a transfer transaction: BEGIN, two UPDATEs, COMMIT.

Starter code

query.sql
-- write transfer

Sample solution

query.sql
BEGIN;
UPDATE accounts SET balance = balance - 100 WHERE id = 1;
UPDATE accounts SET balance = balance + 100 WHERE id = 2;
COMMIT;

Expected output

Transaction tamamlandı

Questions and answers

Review the lesson questions together with their answers. To test yourself, solve the lesson interactively.

1 ACID A

Question
A: ____ (ya hep ya hiç)
Answer
A: Atomicity (ya hep ya hiç)

Explanation: Atomicity is the right answer.

2 ACID: match the terms

Term Meaning
Atomicity indivisible
Consistency consistent
Isolation isolated
Durability durable

3 What does A mean in ACID?

  • Always
  • Automatic
  • Atomicity Correct answer
  • Access

Explanation: A in ACID means Atomicity.

All lessons in Intermediate