GITTA-Logo
PDF Version of this document Search Help

Lesson Navigation IconStructured Query Language SQL

Unit Navigation IconSQL overview

Unit Navigation IconCreation and modification of tables

Unit Navigation IconBasic database queries

LO Navigation IconSelect-From-Where

LO Navigation IconMultiple conditions

LO Navigation IconComparison operators

LO Navigation IconArithmetical operators

LO Navigation IconNested queries

LO Navigation IconJoin

LO Navigation IconNon-relational constructs

LO Navigation IconSet operators

LO Navigation IconSummary

LO Navigation IconDatabase queries

Unit Navigation IconSQL Insert, Delete and Update

Unit Navigation IconUsage of SQL

Unit Navigation IconSummary

Unit Navigation IconRecommended Reading

Unit Navigation IconBibliography

Unit Navigation IconMetadata


GITTA/CartouCHe news:


Go to previous page Go to next page

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.
Basic SQL queries

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)
Top Go to previous page Go to next page