ACID
- SQL course
- Intermediate
- Lesson 104/115
- 4 min
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şiklikFour 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
-- write transferSample solution
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
A: ____ (ya hep ya hiç)
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.