The basic structure of an SQL expression consists of three clauses:
- The select clause corresponds to the projection operation of the relational algebra. It is used to list the attributes desired in the result of a query.
- The from clause corresponds to the Cartesian-product operation of the relational algebra. It lists the relations to be scanned in the evaluation of the expression.
- The where clause corresponds to the selection predicate of the relational algebra. It consists of a predicate involving attributes of the relations that appear in the from clause.