top of page

SQL Operators

As we discussed, We can perform lot of manipulation on sql datasets and tables. This can be achieved with the help of sql operators. They are divided into few categories let's dicuss each one in details.

Classification of SQL Operators

  1. Airthmetic Operators

  2. Comparison Operators

  3. Logical Operators

Airthmetic Operators

Arithmetic operators are used to perform basic arithmetic calculations and operations on numbers.

Symbol
Name
Explanation
+
Addition
gives sum
-
Subtraction
gives difference
*
Multiplication
Gives product
/
Division
gives quotient
%
Modulus
Gives remainder

Comparison Operators

Comparison operators are used to compare two values.

Symbol
Description
=
Equal to
!=, <>
Not equal to
>
greater than
<
less than
>=
greater than or equal to
<=
less than or equal to

Logical Operators

Logical operators are used to check the logic in subqueries and inside where clause and if the condition is satisfied then it will return the output.

Name
Explanation
AND
It compares two or more conditions and returns true if all the conditions are true.
OR
It compares two or more conditions and returned true if any one condition is true.
Not
It is use for negation purpose
IN
It is use to check whether certain elements are present from the given list.
Like
It is use to fetch the reocrds when certain value is like or similar to given condition.
IS NULL
It is use to fetch the null records from the table.
ALL
It compare all the values of subquery with main query and if all condition is satisfied than it will return the results.
ANY
It compare the subquery and if any record satisfies the condition then it will return the result from main query.
Exists
It is use to fetch the result of the main query if the value of inner query is not null.
bottom of page