Sunday, 22 November 2020

Describe the four clauses in the syntax of a simple SQL retrieval query.

 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:

  1. SELECT
  2. FROM
  3. WHERE
  4. ORDER BY
  5. 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)

No comments:

Post a Comment