An operator manipulates individual data items and returns a result. The data items are called operands or arguments. Operators are represented by special characters or by keywords.
- Unary and Binary Operators
- Arithmetic Operators
- Concatenation Operator
- Comparison Operators
- Logical Operators: NOT, AND, OR
- Set Operators: UNION [ALL], INTERSECT, MINUS
- Other Built-In Operators
- IS NULL and IS NOT NULL
- IN and NOT IN
- EXISTS and NOT EXISTS
- BETWEEN AND
- User-Defined Operators
Unary and Binary Operators
Unary operators need only one operand to perform the task or operation.
e.g +, –
Here “+” and “-” operators will indicate the sign of operand. (e.g +5, -30, -4.5 )
Binary operators required two operands to perform the operation.
e.g +, -, *, /, % etc
Here these + and – operators will not indicate the sign of operand but add or subtract two operands. (e.g 3+5, 3–5)
understand unary and binary operators like below.
e.g. +2 – -3.5 * +4 can be written as (+2) – (-3.5) * (+4) for better readability and understandability. Look at the diagram below to know which operator is unary and which one is binary.