🗄️

SQL Advanced

Indexes, transactions, views and normalization.

3 lessons 5 tasks
Lessons Quiz Certificate

📚 Lessons

1 Indexes & performance

An index speeds up lookups on a column at the cost of slower writes and extra storage. Index columns used in WHERE, JOIN and ORDER BY.

CREATE INDEX idx_orders_user ON orders (user_id);
-- now this lookup can use the index
SELECT * FROM orders WHERE user_id = 42;

2 Transactions

A transaction groups statements so they all succeed or all roll back — preserving consistency (ACID). Wrap related writes together.

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

3 Views & normalization

A view is a saved query you can treat like a table. Normalization removes redundancy by splitting data into related tables linked by keys.

CREATE VIEW active_customers AS
SELECT id, name FROM users WHERE last_login > '2026-01-01';

📝 Tasks

5 tasks across 2 pages — multiple-choice and fill-in (type the answer). Score 70% or higher to earn your certificate.

🎓 Certificate of Completion

🔒 Pass the quiz above (70%+) to unlock your downloadable certificate.