Relational Queries, 1974

SQL has outlived almost every language that was supposed to replace it. This era seeds real tables and lets you interrogate them with SELECT, WHERE, ORDER BY, GROUP BY and JOIN until the answers stop surprising you.

Code and data track · 6 missions · boss mission, no written exam · free, no signup. Everything below runs in the browser terminal on the SERVBG home page.

Open Relational Queries in the terminal

What you will do

  1. read rows from a table SELECT * FROM users;

    SQL was born at IBM in 1974 (SEQUEL). You describe WHAT you want; the engine figures out how.

  2. filter rows with a condition SELECT * FROM users WHERE city = 'Sofia';

    WHERE is a filter over rows. =, >, <, LIKE — the query narrows to exactly what matters.

  3. sort the result set SELECT * FROM users ORDER BY age DESC;

    ORDER BY sorts on any column, ASC or DESC. The database does the heavy lifting for you.

  4. aggregate — count the rows SELECT COUNT(*) FROM users;

    Aggregates (COUNT, SUM, AVG, MIN, MAX) collapse many rows into one answer.

  5. group, then aggregate per group SELECT city, COUNT(*) FROM users GROUP BY city;

    GROUP BY buckets rows, then aggregates each bucket. "How many per city?" in one line.

  6. Boss missioncombine two tables on a key SELECT name, total FROM users JOIN orders ON users.id = orders.user_id;

    JOIN is the heart of relational: relate rows across tables by a shared key. Normalise, then join back.

Certificate

This is one of the original eras, so it ends at the boss mission: there is no written exam and no certificate for it. Clearing the boss marks the era complete and banks the XP. The expansion tracks (networking, Cisco IOS, FortiOS, containers, Kubernetes, cloud, operations, defence, models and the nine graphics eras) are the ones that carry exams.

Nearby eras

Previous
2006 · The Object Shell
Cross the leap to PowerShell: dir becomes Get-ChildItem, and the pipe stops passing text and starts passing objects.
Next
1991 · The Readable Language
A working Python REPL (print, arithmetic, variables, strings, lists, loops, len and sum) that actually evaluates what you type.

All 25 eras in the Terminal Academy

Open Relational Queries in the terminal