What is SQL?
Structured Query Language — the universal grammar of relational data.
SQL (Structured Query Language) is the ANSI/ISO standardised language for talking to relational databases. It dates back to IBM in the 1970s and is the lingua franca of every relational DB — MySQL, PostgreSQL, Oracle, SQL Server, SQLite all speak it.
SQL is declarative — you describe WHAT you want (SELECT name FROM users WHERE age > 18), the database engine figures out HOW to get it. Plans, indexes, join order — all the database's job.
sql-- Your first SQL statement SELECT 'Hello, SQL!' AS message;
(Run in MySQL Workbench, pgAdmin, or any SQL playground — actual values depend on the data in YOUR tables.)
Every backend role on the planet expects SQL fluency. Learning it once pays dividends across every database vendor for your whole career.
- Standardised by ANSI (1986) and ISO (1987); updated roughly every 5-7 years.
- Declarative (what) vs imperative (how) — the engine plans execution.
- Same SQL runs on Postgres, MySQL, Oracle, SQLite — modulo vendor extensions.
- Three sub-languages: DDL (CREATE/ALTER/DROP), DML (INSERT/UPDATE/DELETE/SELECT), DCL (GRANT/REVOKE).
- Read-mostly workloads = SELECT-heavy; write-heavy = INSERT/UPDATE-heavy.
- Run
SELECT VERSION();on any SQL database — note the dialect. - Compare the same SELECT in MySQL and PostgreSQL — observe identical behaviour.
- Read the Wikipedia entry on SQL standards — note ANSI vs ISO timeline.
- When learning, default to a standards-compliant subset — ports easily across DBs.
- Watch out for vendor extensions (
AUTO_INCREMENT,RETURNING, etc.) that aren't portable. - Books: 'SQL Performance Explained' (Markus Winand) is the classic.
Run any SELECT, INSERT, JOIN or GROUP BY against the seeded users · products · orders tables — your changes are sandboxed and reset whenever you click Reset DB.
// see seed schema (3 tables · 8 users · 8 products · 12 orders)
users (id, name, email, country, age, created_at) products (id, name, price, stock, category) orders (id, user_id → users.id, product_id → products.id, qty, total, created_at)
Each challenge is auto-graded — write the SQL, click Submit answer, and we'll compare your result-set to the canonical one.
Quick recap quiz?
We'll generate 5 MCQs from this lesson and check your understanding instantly. Takes ~30 seconds.
