The SQL course — start at the prologue
First lesson: Como o curso funciona
Interactive SQL course · 12 chapters · 77 lessons
Write SQL on a live database
From your first SELECT to window functions, EXPLAIN and a final analytics report.
Every query runs right inside the lesson — on a real database, not a screenshot. Plus quizzes, fix-the-query drills and gates from the trainer.
- live SQL in every lesson
- tasks from real interviews
- a certificate and an exam
PostgreSQL · MySQL · ClickHouse
SELECT c.name, count(*) AS orders, sum(o.total) AS revenue FROM orders o JOIN customers c ON c.id = o.customer_id WHERE o.status = 'paid' GROUP BY c.name ORDER BY revenue DESC LIMIT 4;
| name | orders | revenue |
|---|---|---|
| Мурка | 4 | 12 480 |
| Барсик | 3 | 9 120 |
| Рыжик | 3 | 7 640 |
| Сима | 2 | 5 300 |
Outcome
One question — six levels of SQL
"Who brings the store its money?" — the question stays. What changes is the SQL you answer it with.
SELECT id, customer_id, total FROM orders WHERE status = 'paid' ORDER BY total DESC LIMIT 3;
result
| id | customer_id | total |
|---|---|---|
| 1042 | 7 | 4 900 |
| 1017 | 3 | 4 100 |
| 1099 | 7 | 3 780 |
Chapter 2 — filters, sorting, limiting the result.
Mechanics
What a lesson is made of
Not a video and not lecture notes. Six kinds of block: theory is in every lesson, the rest are chosen to fit the topic — a live query, a diagram, a quiz, fix-the-query — and the chapter closes with a task from the trainer.
Theory
A short take on one idea — no filler, no "go read the docs".
Diagram
A drawing of the relation or operation: what actually happens to the rows.
Live SQL
The query runs against a real database right on the page. Edit it and run again.
Quiz
A comprehension question, not recall: why the result is what it is.
Fix the query
Broken SQL you have to repair — the most honest self-check there is.
Task gate
A chapter closes on a real trainer task, not a "read it" checkbox.
Signal "Kotomarket" · Vault-9 · 2184
A database you bring back yourself
One untouched shard of old Earth's internet remains — the database of the Kotomarket store. Each chapter opens the next clearance level into the archive: first one table, then the relations, then the whole system. K.'s message waits in the last block.
The story does not replace the teaching — it holds the order of topics. Every clearance level maps to a real step in SQL.
The program
Five clearance levels
12 chapters are not 12 equal bullet points but five steps: access the data → relate and count → analytical SQL → run the system → the final report.
ACCESS 01
3 chapters · 16 lessons · 4 h 21 minGet access to the data
What a database is, how a table is built and how to ask it a precise question
You talk to a database for the first time — and it answers exactly what you asked.
Primeiros passos com SQL
You will run your first query against a real database — in the browser, with nothing to install.
Bancos de dados sem mistério
You will stop confusing a database with a DBMS and learn to read a five-table schema like a map.
SELECT: extraindo os dados certos
You will pull exactly the rows you need: filters, ranges, sorting, CASE.
This is where the free part ends
By this point you have tried everything the course is made of: live SQL on a real database, diagrams, quizzes, fix-the-query and a task gate.
- you know what a table, a key and a schema are
- you write SELECT with filters and sorting
- you read NULL correctly and avoid the three-valued trap
- you have already passed your first trainer gate
What comes next
Aggregates, JOINs, CTEs, window functions, DDL, EXPLAIN and the capstone — the whole Kotomarket system. One lesson in every paid chapter stays open: 9 more lessons to read with no payment.
ACCESS 02
4 chapters · 29 lessons · 15 h 49 minRelate and count
Aggregates, JOINs, subqueries and CTEs, strings and dates
Analysis emerges from single rows: relations come together, thousands of rows fold into a metric.
Agregação: medindo o negócio
You will turn thousands of rows into one clear metric and not trip over HAVING versus WHERE.
JOIN: montando dados a partir das relações
You will build an answer from several tables and learn to spot row fan-out before it ruins the number.
Subconsultas e CTEs: consultas em vários lances
You will decompose a hard query into readable steps with WITH — instead of three-storey nesting.
Strings, datas e tipos: deixando os dados em forma
You will bring messy strings and dates into report-ready shape: intervals, truncation, casts.
The course runs on PostgreSQL, but SQL does not end at one engine. The same question — "revenue by month" — is written differently in three dialects, and the course shows exactly where.
SELECT date_trunc('month', created_at)::date AS month, sum(total) AS revenue FROM orders GROUP BY month;
PostgreSQL — First day of the month — a date-truncation function. (the course dialect)
In the trainer each dialect has its own sandbox: PostgreSQL, MySQL and ClickHouse run on real servers.
ACCESS 03
1 chapter · 8 lessons · 5 h 31 minAnalytical SQL
Window functions — ranks, running totals, comparing a row with its neighbour
Until now you wrote queries. Here you start thinking like a strong SQL user.
Funções de janela: análise sem perder linhas
You will compute ranks, shares and running totals without losing a single row — the reason analysts reach for SQL.
The task gates in the chapters are not textbook exercises. They come from the same catalogue used in the trainer: wordings taken from real interviews at Russian tech companies.
The task. For every category find the product with the highest revenue. If several products tie for the maximum — return all of them.
expected result
| category | product | revenue |
|---|---|---|
| корм | Мяу-микс 4 кг | 184 200 |
| игрушки | Мышь-дразнилка | 96 400 |
| игрушки | Лазер PRO | 96 400 |
The last two rows are exactly the tie that makes ROW_NUMBER() the wrong tool here.
WITH ranked AS ( SELECT category, product, revenue, rank() OVER ( PARTITION BY category ORDER BY revenue DESC ) AS rnk FROM product_revenue ) SELECT * FROM ranked WHERE rnk = 1;
ACCESS 04
3 chapters · 18 lessons · 12 h 4 minRun the system
DML, schema and normalisation, transactions, indexes and execution plans
The database stops being a black box: you change data, design the schema and read the plan.
DML: alterando dados sem pânico
You will change data without fear: a transaction, a precise WHERE, RETURNING and a rollback.
DDL: um schema em que você pode confiar
You will design a schema you can trust: types, constraints, normal forms, migrations.
Sob o capô do PostgreSQL: transações, planos, índices
You will read an execution plan and see why a query is slow — and what an index would change.
At the last level a query stops being text and becomes a tree of operations. You open EXPLAIN ANALYZE, see a Seq Scan where you expected an Index Scan, add an index — and watch the plan change.
- read a plan and find the bottleneck in it
- know when an index helps and when it only slows writes down
- explain ACID and isolation levels by behaviour, not by textbook
ACCESS 05
The final transmission
Capstone: a full analytics report on the archive — and K.'s message
Capstone: analytics da loja
You will assemble the final analytics report on the whole archive — and open the last block.
The finish line
How the course ends
Not "four more features" but the state you leave the course in.
Your state at the exit
77 / 77 · exam passed · certificate unlocked
The end is not a "finish" button. The capstone report closes the archive, the exam checks you write the queries yourself, and the certificate gets a public page with authenticity verification.
One-on-one duels
Same task, two people, the clock on the board. Practice that is hard to put down.
Leaderboard
Lessons and tasks earn Power — it counts towards the arena leaderboard.
Exam
A separate timed check: no hints and no immediate second attempt.
Your first query — right now
The first three chapters are open with no payment — 16 lessons: how a database works, SELECT, filters and your first useful report.
Start free — 16 lessons