Database: SELECT: Syntax

SELECT [DISTINCT] {select-item [AS alias]},...
The select-item can be one of the following: Example:
SELECT People.first_name, email, (dogs-cats) AS more_dogs
FROM virtual-table
Where virtual-table is
WHERE condition
The condition can be one of:
GROUP BY grouping-column,...
Typically is used when summary functions are used in the SELECT clause.
HAVING condition
See condition for the WHERE clause. The HAVING conditions are applied to the rows that result from the GROUP BY clause. The condition will always have at least one column function.
ORDER BY {column [DESC]},...
Where column is either a column name or column number. Ascending order is the default; specify DESC for descending order.

Notation: UPPERCASE words are SQL keywords. [square brackets] enclose optional elements. ",..." follows an item that can be repeated in a comma-separated list. {curly braces} group elements for use with ",..." or |. | (vertical bar) separates alternatives. Italic words stand for something the user supplies.