GITTA-Logo
PDF Version of this document Search Help Glossary

Lesson Navigation IconSpatial Queries

Unit Navigation IconIntroduction to spatial queries

Unit Navigation IconThematic query

LO Navigation IconRelational operators

LO Navigation IconArithmetic operators

LO Navigation IconLogical operators

LO Navigation IconCombination of operators

LO Navigation IconFormulate queries

Unit Navigation IconGeometric query

Unit Navigation IconTopological query

Unit Navigation IconSummary

Unit Navigation IconGlossary

Unit Navigation IconBibliography

Unit Navigation IconMetadata


GITTA/CartouCHe news:


Go to previous page Go to next page

Combination of operators

By combining operators, it is possible to link multiple conditions.

The Boolean operators are not commutative. That means, in complicated expressions the result depends on the mathematically defined order of the subparts of the expression. Using brackets, the order can be completely changed (Bill 1999).

Nested Queries

Circle 1: Tree species = "Larch"
Circle 2: Stock > 110 m3/ha
Circle 3: Density > 80%

Venn-diagram Condition Corresponding SQL query
(3 AND 2) OR 1 Select *
from Parcel
where (Density > 80% and Stock > 110 m3/ha)
or Tree species = "Larch"
1 AND (3 OR 2) Select *
from Parcel
where Tree species = "Larch"
and (Density > 80% or Stock > 110 m3/ha)
(3 XOR 1) AND 2 Select *
from Parcel
where (Density > 80% xor Tree species = "Larch" )
and Stock > 110 3/ha
(2 OR 1) NOT 3 Select *
from Parcel
where (Stock > 110 m3/ha or Tree species = "Larch")
not Density > 80%
3 OR (2 XOR 1) Select *
from Parcel
where Density > 80% or (Stock > 110 m3/ha
xor Tree species = "Larch")

Applications

Try to solve the following exercises. Consider, in particular, which operator is used:


Select all the roads of the type "Nebenstrasse", where the speed is limited to 50km/h (select the objects by clicking on the rows of the table).

Select all the roads (all road types), where the speed is limited to 50km/h (select the objects by clicking on the rows of the table).

Select all the roads, where the speed is limited to 50km/h and which are not "Nebenstrassen" that have no limited velocity of 50km/h. Select also all the roads which are "Nebenstrasse" and which have no speed limit of 50km/h (select the objects by clicking on the rows of the table).

Select all the roads, where the speed is limited to 50km/h, but which are not "Nebenstrassen" (select the objects by clicking on the rows of the table).

Top Go to previous page Go to next page