SQL Operators
Every database administrator and user uses SQL queries for manipulating and accessing the data of database tables and views. The manipulation and retrieving of the data are performed with the help of reserved words and characters, which are used to perform arithmetic operations, logical operations, comparison operations, compound operations, etc.
What is SQL Operator?
The SQL reserved words and characters are called operators, which are used with a WHERE clause in a SQL query. In SQL, an operator can either be a unary or binary operator. The unary operator uses only one operand for performing the unary operation, whereas the binary operator uses two operands for performing the binary operation.
What is the Precedence of SQL Operator?
The precedence of SQL operators is the sequence in which the SQL evaluates the different operators in the same expression. Structured Query Language evaluates those operators first, which have high precedence.
In the following table, the operators at the top have high precedence, and the operators that appear at the bottom have low precedence.
SQL Operator Symbols | Operators |
---|---|
** | Exponentiation operator |
+, - | Identity operator, Negation operator |
*, / | Multiplication operator, Division operator |
+, -, || | Addition (plus) operator, subtraction (minus) operator, String Concatenation operator |
=, !=, <, >, <=, >=, IS NULL, LIKE, BETWEEN, IN | Comparison Operators |
NOT | Logical negation operator |
&& or AND | Conjunction operator |
OR | Inclusion operator |