For the user, the most important feature of relational databases
is the existence of a high-level
query language called SQL (=Sequential Query Language), sometimes pronounced as "sequel".
Over time we may describe some features of this language, but as there are many excellent
texts online available we rather refer to some of these below.
an SQL query has roughly the following structure (but see
SELECT [TOP ...] ...
[GROUP BY ... ]
[ORDER BY ...]
For an exact grammar see for example the BNF of the SQL2003 standard.
That standard is in general exactly what is supported by a particular
In this help page we use the publicly available
for examples. We (try to) use upper case for the SQL keywords, though the
language is case-insensitive.
The SELECT determines the form of the result by indicating
precisely which columns are returned, and possibly under what name.
Return all columns
Return the named columns
SELECT snapnum, lookbackTime
Return the named columns, but rename them
SELECT snapnum as snapshot
, redshift as z
Common Table Expressions