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):

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);