codescracker


sql

SQL Operators



« Previous Tutorial Next Tutorial »


Operators in SQL, are used to perform the operation(s). There are four types of operators available in SQL:

SQL Arithmetic Operators

Here are the list of all the arithmetic operators available in SQL:

Operator Symbol Operator Name
+ Addition Operator
- Subtraction Operator
* Multiplication Operator
/ Division Operator
% Modulus Operator

SQL Comparison Operators

The following table lists the comparison operators available in SQL:

Operator Meaning
= This operator is used to check whether the value of the two operands are equal to not. If yes then the condition becomes true, otherwise false
!= This operator is used to check whether the value of the two operands are equal or not. If not equal, then the condition becomes true, otherwise false
<> This operator is used to check whether the value of the two operands are equal or not. If not equal, then the condition becomes true, otherwise false
> This operator is used to check whether the value of the left operand is greater than the value of the right operand or not. If yes, then the condition becomes true, otherwise false
< This operator is used to check whether the value of the left operand is less than the value of the right operand or not. If yes, then the condition becomes true, otherwise false
>= This operator is used to check whether the value of the left operand is greater than or equal to the value of the right operand or not. If yes, then the condition becomes true, otherwise false
<= This operator is used to check whether the value of the left operand is less than or equal to the value of the right operand or not. If yes, then the condition becomes true, otherwise false
!< This operator is used to check whether the value of the left operand is not less than the value of the right operand or not. If yes, then the condition becomes true, otherwise false
!< This operator is used to check whether the value of the left operand is not greater than the value of the right operand or not. If yes, then the condition becomes true, otherwise false

SQL Logical Operators

Here, the following table lists all the logical operators available in SQL:

Operator Name Meaning
ALL All Operator This operator is used to compare a value to all the values in another value set
AND AND Operator This operator allows the existence of multiple conditions in an SQL statement's WHERE clause
ANY ANY Operator This operator is used to compare a value to any applicable value in the list according to the condition
BETWEEN BETWEEN Operator This operator is used to search for the values that are within a set of values, given the minimum value and the maximum value
EXISTS EXISTS Operator This operator is basically used to search for the presence of a row in a specified table that meets certain criteria
IN IN Operator This operator is basically used to compare a value to a list of literal values that have been specified
LIKE LIKE Operator This operator is basically used to compare a value to similar values using the wildcard operators
OR OR Operator This operator is used to combine multiple conditions in an SQL statement's WHERE clause
IS NULL NULL Operator This operator is used to compare a value with a NULL value
UNIQUE UNIQUE Operator This operator is used to search every row of a specified table for the uniqueness
NOT NOT Operator This operator is used to reverse the meaning of the logical operator

« Previous Tutorial Next Tutorial »



Tools
Calculator

Quick Links
Signup - Login - Give Online Test