There are a
whole lot of standards for generic SQL. These include ISO and ANSI. There are
also revisions to the standards as new features are released. I have heard of
the SQL-92 standard. But there are many more, the latest of which I have heard
of is SQL-2011. These are standards for the SQL language itself, apart from any
vendor implementation versions.
SQL itself
is a declarative language. That means you tell SQL what you want, and it does
it. To retrieve data, you issue the SELECT command with a specific order of
keywords: SELECT, FROM, WHERE, GROUP BY, HAVING and ORDER BY. The SQL engine
will process those keywords in the following order: FROM, WHERE, GROUP BY,
HAVING, SELECT, and ORDER BY.
The processing order is important. One example
is that aliases you define in the SELECT clause can only be referenced in it
and the ORDER BY clause. All of the other parts of the full SQL statement are
processed prior to the SELECT. There are some other specialized optional parts
of a SELECT statement that are processed after the ORDER BY. These include TOP
and OFFSET.