|
In this Unit it was shown step by step how SQL statements are phrased.
To show all the parts in context a complete SQL request is listed below.
Complete syntax of a SQL request:SELECT [DISTINCT | ALL]
<Attribute> [AS <Name>] [, ...] | *
FROM <Relation> [, <Relation>]
[WHERE <Condition>]
[GROUP BY <Column> [HAVING <Condition>]
[ORDER BY <Column> [ASC | DESC], [, ...]];
A large part of this syntax is optional and only needs to be stated only in certain cases. Teh simplest syntactically
correct request
has only a SELECT- and a FROM-part. Only with more complex problems, all parts are used in the same request.
DISTINCT
is used to delete such duplicates from the result.
The keyword ALL
is used to prevent the duplicates from deletion.
This is the default and does not have to be stated explicitly.