What is SQL?
The standard language for talking to relational databases, and how its dialects differ across MySQL, PostgreSQL, and others.
2 min read
SQL (Structured Query Language) is the language used to store, retrieve, and manipulate data in a relational database — one that organizes data into tables of rows and columns, with relationships between tables defined through shared keys. Unlike a general-purpose programming language, SQL is mostly declarative: you describe the data you want, not the steps to retrieve it.
SELECT name, email FROM users WHERE signup_date > '2024-01-01';You're not telling the database how to find these rows — loop through this file, check this condition — you're describing the result you want, and the database engine's query planner decides how to actually execute it (which the later lesson on indexes touches on).
The categories of SQL statements
SQL commands are usually grouped by what they do:
- DDL (Data Definition Language) —
CREATE,ALTER,DROP— defines the structure: tables, columns, constraints. - DML (Data Manipulation Language) —
INSERT,UPDATE,DELETE— changes the data inside that structure. - DQL (Data Query Language) —
SELECT— reads data back out. This is what you'll use constantly, and where this course spends most of its time. - DCL / TCL — permissions (
GRANT,REVOKE) and transactions (COMMIT,ROLLBACK) — covered briefly later in this course.
SQL is a standard, but every database has its own dialect
SQL is standardized by ANSI/ISO, but no database implements the standard exactly — each one (MySQL, PostgreSQL, SQL Server, SQLite, Oracle) adds its own extensions and has its own quirks. LIMIT 10 works in MySQL, PostgreSQL, and SQLite; SQL Server uses TOP 10 instead; Oracle historically used ROWNUM. String concatenation, date handling, and auto-incrementing IDs all vary similarly.
This course teaches standard SQL that works across the common dialects, and calls out dialect differences explicitly where they matter — so what you learn transfers, even though the exact syntax you'll type on a real job depends on which database you're using.
Where SQL runs
You write SQL and send it to a database server — a separate process (or, for SQLite, an embedded library) that stores the actual data and executes your queries against it. Your application code (in JavaScript, Python, or any other language) connects to that server over the network and sends SQL statements to it, typically through a database driver or an ORM that generates SQL for you behind the scenes.
The rest of this course works with a running relational database — the next lesson covers the table structure SQL operates on before you write your first SELECT.