SQL reference

SQL glossary

Concise definitions of concepts used in lessons and exercises.

SELECT

Chooses the columns returned in the result.

FROM

Specifies the main table to query.

WHERE

Filters rows before display or aggregation.

JOIN

Connects multiple tables through a shared key.

LEFT JOIN

Keeps every row from the left table, even without a match.

GROUP BY

Groups rows to calculate totals, averages or counts.

HAVING

Filters groups after an aggregation.

ORDER BY

Sorts results in ascending or descending order.

SUM

Adds values from a numeric column.

COUNT

Counts rows.

AVG

Calculates an average.

COALESCE

Replaces NULL with a fallback value.

NULL

Represents a missing value.

Primary key

Unique identifier for a row in a table.

Foreign key

Column used to connect one table to another.