SQL command families
Core idea
SQL commands serve different purposes: SELECT retrieves data, INSERT/UPDATE/DELETE change rows, CREATE/ALTER/DROP define objects, and transaction commands control groups of changes. DQL, DML, DDL, DCL and TCL are useful teaching labels, not a universal formal classification; SELECT is sometimes grouped with DML.
Minimal example
SELECT id, name FROM products ORDER BY id;Expected rows (in order):
1 | Notebook2 | Pen3 | Bag4 | PencilHow it works
Permissions are commonly taught as DCL (GRANT and REVOKE); transaction control as TCL (COMMIT and ROLLBACK). For now, recognize purposes rather than execute unfamiliar write commands. The next example reads a constant and is harmless. Later chapters will teach writes in disposable fixtures. DDL transaction behavior differs across engines.
Practical example
SELECT 'read only' AS purpose;Expected rows (in order):
read onlyPractice
Classify creating a table, correcting a price, listing products and undoing an uncommitted change. Do not execute these changes yet.