SQL is the standard language of relational databases. It has a data definition part (DDL) that creates and changes schemas and constraints, a data manipulation part (DML) that inserts, updates and deletes rows, and a query part built around the SELECT ... FROM ... WHERE block.
Short notes6 min read
Most real queries combine tables with joins, summarise rows with aggregate functions, and must cope with missing values. These three features interact: an outer join manufactures NULLs, aggregate functions skip NULLs, and the WHERE and HAVING filters drop anything whose condition is UNKNOWN.
Short notes8 min read
A subquery is a SELECT inside another statement. It lets a query compare a value with a computed set ("salary greater than every salary in EE"), test whether related rows exist ("departments with no employee"), or express "for all" conditions without a division operator.
Short notes10 min read
One-page visual sheets for this topic, in the sheet library on the store. Previews are free; the full sheets come with the subject pack.
Cheat sheets3 sheets