|
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) |
SQL provides the following additional functions for analysis (aggregate functions):
INPUT
Graphic |
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 Parzelle WHERE Vorrat >= (SELECT AVG (Vorrat) FROM
Parzelle); |