SELECT-FROM-WHERE clause
In languages like SQL data from a certain domain (FROM)
that match some conditions (WHERE) are selected and presented (SELECT).
The result can be seen as a new relation.
The syntax of a basic SQL query is:
SELECT <select-list>
FROM <from-list>
WHERE <condition>
In this syntax the...
- <select-list> contains the names of the attributes (columns)
values to be returned.
- <from-list> is the list of the relations (tables)
used for the query.
- <condition> is an expression that identifies the
tuples that we are looking for.
We saw the basic statements that are needed for making queries with SQL.
Of course there are extensions which allow more specific or more flexible
queries.
These extensions include:
- multiple conditions (in boolean AND/OR combination)
- complex conditions (subqueries, joins etc.)
- pattern matching and arithmetical operators
- non-relational functions (sort, group, aggregate)
- set operators (union, intersect, minus)