Question: 4.4. Describe the four clauses in the syntax of a simple SQL retrieval query. Show what type of constructs can be specified in each of the clauses. Which are required and which are optional?
Solution:
- SELECT
- FROM
- WHERE
- ORDER BY
- Limit
SELECT
List of attribute names to be received by the query
FROM
The tables that these attributes with be retrieved from
WHERE
Conditional boolean expression to identify certain tuples to be retrieved (optional)
ORDER BY
Attribute list to order the result by (optional)
LIMIT BY
This is used to limit the number of rows (optional)