Previous Topic: DQL StatementsNext Topic: SQL Statements


SQL Keywords

Keyword

Operand

Explanation

SELECT

selection-list

Starts an SQL query or dialog. Specifies the data to be retrieved. The items in a selection list can be: column names, mathematical functions, arithmetic expressions, and literal constants.

FROM

table-names

Identifies the table or tables where data can be found.

WHERE

predicate

Tests each row in the named tables. If the result of the test is true, the row is selected. A predicate can be a comparison or a special search condition.

GROUP BY

column-names

Arranges data in groups. Usually used when needed for applying functions (like SUM) to groups of data.

HAVING

predicate

Used with GROUP BY to retrieve rows whose groups meet the search condition.

ORDER BY

select-list-items

Lists column names to specify the order in which data is to be presented. Columns listed must be in the SELECT clause. Ascending order is the default but DESC (descending) can be specified.