Expedition · Vault-9

The SQL course — start at the prologue

First lesson: Como o curso funciona

0/77
lessons done
0· +10/lesson

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

the Kotomarket schema
FKcustomersPK idnamecityordersPK idFK customer_idtotalstatus
postgresql · lesson 4.2
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;
23 ms · 4 rows
nameordersrevenue
Мурка412 480
Барсик39 120
Рыжик37 640
Сима25 300
12
chapters
77
lessons
16
free
3
SQL dialects

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.

01 · SELECTPull the rows you need
SELECT id, customer_id, total
FROM orders
WHERE status = 'paid'
ORDER BY total DESC LIMIT 3;

result

idcustomer_idtotal
104274 900
101734 100
109973 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.

01

Theory

A short take on one idea — no filler, no "go read the docs".

02

Diagram

A drawing of the relation or operation: what actually happens to the rows.

03

Live SQL

The query runs against a real database right on the page. Edit it and run again.

04

Quiz

A comprehension question, not recall: why the result is what it is.

05

Fix the query

Broken SQL you have to repair — the most honest self-check there is.

06

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.

I

ACCESS 01

3 chapters · 16 lessons · 4 h 21 min

Get 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.

00FREE

Primeiros passos com SQL

You will run your first query against a real database — in the browser, with nothing to install.

SELECT 1песочница
3 lessons · 15 min
01FREE

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.

СУБДтаблицы и ключиER-схема
5 lessons · 1 h 10 min
02FREE

SELECT: extraindo os dados certos

You will pull exactly the rows you need: filters, ranges, sorting, CASE.

WHERENULLORDER BYDISTINCT
8 lessons · 2 h 56 min
ACCESS LEVEL 01 · CLEARED16 / 16 free lessons

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.

II

ACCESS 02

4 chapters · 29 lessons · 15 h 49 min

Relate 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.

031 free lesson PRO

Agregação: medindo o negócio

You will turn thousands of rows into one clear metric and not trip over HAVING versus WHERE.

COUNT / SUMGROUP BYHAVING
7 lessons · 2 h 55 min
041 free lesson PRO

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.

INNER / LEFTFULLanti-joinfan-out
8 lessons · 3 h 5 min
051 free lesson PRO

Subconsultas e CTEs: consultas em vários lances

You will decompose a hard query into readable steps with WITH — instead of three-storey nesting.

подзапросыWITHEXISTSUNION
8 lessons · 5 h 16 min
061 free lesson PRO

Strings, datas e tipos: deixando os dados em forma

You will bring messy strings and dates into report-ready shape: intervals, truncation, casts.

date_truncинтервалыCAST
6 lessons · 4 h 33 min
ProofOne SQL — three environments

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;

PostgreSQLFirst 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.

III

ACCESS 03

1 chapter · 8 lessons · 5 h 31 min

Analytical 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.

071 free lesson PRO

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.

OVER()PARTITION BYLAG / LEADtop-N
8 lessons · 5 h 31 min
ProofA task from a real interview

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.

ЯндексVKСберOzonWildberriesAvito

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

categoryproductrevenue
кормМяу-микс 4 кг184 200
игрушкиМышь-дразнилка96 400
игрушкиЛазер PRO96 400

The last two rows are exactly the tie that makes ROW_NUMBER() the wrong tool here.

your answerchecked on a real database
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;
RANK() rather than ROW_NUMBER() — otherwise a tie silently drops a product.
IV

ACCESS 04

3 chapters · 18 lessons · 12 h 4 min

Run 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.

081 free lesson PRO

DML: alterando dados sem pânico

You will change data without fear: a transaction, a precise WHERE, RETURNING and a rollback.

INSERT / UPDATEUPSERTTRANSACTION
6 lessons · 4 h 32 min
091 free lesson PRO

DDL: um schema em que você pode confiar

You will design a schema you can trust: types, constraints, normal forms, migrations.

CREATE TABLECONSTRAINTнормализация
6 lessons · 3 h 37 min
101 free lesson PRO

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.

EXPLAINиндексыACIDизоляция
6 lessons · 3 h 55 min
ProofThe course does not end at SELECT

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
V

ACCESS 05

The final transmission

Capstone: a full analytics report on the archive — and K.'s message

111 free lesson PRO

Capstone: analytics da loja

You will assemble the final analytics report on the whole archive — and open the last block.

капстоунотчётсертификат
6 lessons · 4 h 28 min

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