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

Relational operators

The relational operators are not only used for numeric attributes, but also for text attributes and other data types. The comparisons "greater than", "less than" etc. are related to the position of an "alphabetical" order used in a computer.

Relational operators sometimes, other spellings are used
= EQ (equal to)
> GT (greater than)
>= GE (greater than or equal to)
< LT (less than)
<= LE (less than or equal to)
<> NE (not equal to)
remark

SQL provides the following additional functions for analysis (aggregate functions):

  • Avg function (average)
  • Count function (number)
  • Min, Max function (minimum, maximum)
  • StDev, StDevP function (standard deviation, standard deviation of the population)
  • Sum function (sum)
  • Var, VarP function (variance, variance of the population)

An example - relational operators

INPUT

GraphicGraphic

Table ''Parcels: tree species (Baumart), stock (Vorrat), and soil type (Bodentyp)''Table ''Parcels: tree species (Baumart), stock (Vorrat), and soil type (Bodentyp)''

QUERY AND RESULTS

SQL operator Result: table Result: graphic
SELECT * FROM Parzelle WHERE Baumart = 'Fichte';
SELECT Baumart, Vorrat, Bodentyp FROM Parzelle WHERE Bodentyp = 'Redzina';
SELECT * FROM Parzelle WHERE Vorrat >120;
SELECT *FROM ParzelleWHERE Vorrat >= (SELECT AVG (Vorrat) FROM Parzelle);
Top Go to previous page Go to next page