SQL (Structured Query Language) is how you talk to a relational database — asking it to store, find, change, or remove data. Every SQL statement falls into one of four families, which is exactly how this section is organized, lesson by lesson.
SQL is a declarative language: you describe the result you want, not the steps to get it. The database engine decides how to actually fetch it.
SELECT name FROM Employee WHERE department = 'IT';Common Mistakes
Every SQL command belongs to one of four families, grouped by what they affect:
| Family | Full name | Affects | Example commands |
|---|---|---|---|
| DDL | Data Definition Language | The structure — tables, columns | CREATE, ALTER, DROP, TRUNCATE |
| DML | Data Manipulation Language | The data inside that structure | SELECT, INSERT, UPDATE, DELETE |
| DCL | Data Control Language | Who can touch it | GRANT, REVOKE |
| TCL | Transaction Control Language | When changes stick | COMMIT, ROLLBACK, SAVEPOINT |
The Mistake Worth Remembering Most
Mixing up DELETE (DML, removes rows) with DROP (DDL, removes the whole table) — one of the most common beginner mistakes in SQL, and one of the most costly to get wrong.
This section walks through each family in its own lesson, plus the querying, functions, and advanced techniques built on top of them. Next up: databases and tables — the structure everything else in SQL operates on.