SELECT
SELECT attribute-expression-list FROM relation-list [ WHERE condition ];
attribute-expression-list:
- [relation-name.]attribute
- [relation-name.]attribute [arithmatic computation] AS another name
- i.e., E.Salary - 40000 AS SalaryDiff
- CASE WHEN ... THEN ...
ELSE ... END
- i.e., CASE WHEN E.Salary < 40000 THEN 0
ELSE E.Salary - 40000 END
relation-list:
- list of table names
- seperate by comma
condition:
- arithmetic operation +, -, *, /
- comparisions =, <>, <, <=, >. >=
- logical connectives AND, OR, NOT
- attribute IN (Q)
- attribute NOT IN (Q)
- attribute op SOME (Q)
- attribute op ALL (Q)
- EXISTS (Q)
- NOT EXISTS (Q)
- IS [NOT] NULL
Read more...