An expression is a string containing variables, constants, operators, or functions.
Expressions always have a certain datatype.
The following table lists some examples of expressions.
Expression | Datatype |
---|---|
3 + 4 | Numeric |
ENAME || ', ' || INIT | Alphanumeric |
LOCATION = 'New York' | Boolean |
12*MSAL > 20000 AND COMMISSION >= 100 | Boolean |
BIRTHDATE + INTERVAL '16' YEAR | Date |
999 | Numeric |
In SQL, arithmetic operators always have precedence over comparison operators, and comparison operators have precedence over logical operators.