9
9
SQL> select 10 / 5;
+--------+
| 10 / 5 |
+--------+
| 2.0000 |
+--------+
1 row in set (0.03 sec)
SQL> select 12 % 5;
+---------+
| 12 % 5 |
+---------+
| 2 |
+---------+
1 row in set (0.00 sec)
(a = b) is
= Checks if the values of two operands are equal or not, if yes then condition becomes true.
not true.
Checks if the values of two operands are equal or not, if values are not equal then (a != b)
!=
condition becomes true. is true.
Checks if the values of two operands are equal or not, if values are not equal then (a <> b)
<>
condition becomes true. is true.
Checks if the value of left operand is greater than the value of right operand, if yes then (a > b) is
>
condition becomes true. not true.
Checks if the value of left operand is less than the value of right operand, if yes then (a < b) is
<
condition becomes true. true.
(a >= b)
Checks if the value of left operand is greater than or equal to the value of right operand, if
>= is not
yes then condition becomes true.
true.
TUTORIALS POINT
Simply Easy Learning
Checks if the value of left operand is less than or equal to the value of right operand, if (a <= b)
<=
yes then condition becomes true. is true.
Checks if the value of left operand is not less than the value of right operand, if yes then (a !< b)
!<
condition becomes true. is false.
Checks if the value of left operand is not greater than the value of right operand, if yes (a !> b)
!>
then condition becomes true. is true.
TUTORIALS POINT
Simply Easy Learning
| ID | NAME | AGE | ADDRESS | SALARY |
+----+----------+-----+---------+----------+
| 2 | Khilan | 25 | Delhi | 1500.00 |
| 4 | Chaitali | 25 | Mumbai | 6500.00 |
| 5 | Hardik | 27 | Bhopal | 8500.00 |
| 6 | Komal | 22 | MP | 4500.00 |
| 7 | Muffy | 24 | Indore | 10000.00 |
+----+----------+-----+---------+----------+
5 rows in set (0.00 sec)
Operator Description
ALL The ALL operator is used to compare a value to all values in another value set.
AND The AND operator allows the existence of multiple conditions in an SQL statement's WHERE clause.
The ANY operator is used to compare a value to any applicable value in the list according to the
ANY
condition.
The BETWEEN operator is used to search for values that are within a set of values, given the
BETWEEN
minimum value and the maximum value.
The EXISTS operator is used to search for the presence of a row in a specified table that meets
EXISTS
certain criteria.
IN The IN operator is used to compare a value to a list of literal values that have been specified.
LIKE The LIKE operator is used to compare a value to similar values using wildcard operators.
The NOT operator reverses the meaning of the logical operator with which it is used. Eg: NOT
NOT
EXISTS, NOT BETWEEN, NOT IN, etc. This is a negate operator.
OR The OR operator is used to combine multiple conditions in an SQL statement's WHERE clause.
IS NULL The NULL operator is used to compare a value with a NULL value.
UNIQUE The UNIQUE operator searches every row of a specified table for uniqueness (no duplicates).
TUTORIALS POINT
Simply Easy Learning
| 1 | Ramesh | 32 | Ahmedabad | 2000.00 |
| 2 | Khilan | 25 | Delhi | 1500.00 |
| 3 | kaushik | 23 | Kota | 2000.00 |
| 4 | Chaitali | 25 | Mumbai | 6500.00 |
| 5 | Hardik | 27 | Bhopal | 8500.00 |
| 6 | Komal | 22 | MP | 4500.00 |
| 7 | Muffy | 24 | Indore | 10000.00 |
+----+----------+-----+-----------+----------+
7 rows in set (0.00 sec)
SQL> SELECT * FROM CUSTOMERS WHERE AGE >= 25 AND SALARY >= 6500;
+----+----------+-----+---------+---------+
| ID | NAME | AGE | ADDRESS | SALARY |
+----+----------+-----+---------+---------+
| 4 | Chaitali | 25 | Mumbai | 6500.00 |
| 5 | Hardik | 27 | Bhopal | 8500.00 |
+----+----------+-----+---------+---------+
2 rows in set (0.00 sec)
SQL> SELECT * FROM CUSTOMERS WHERE AGE >= 25 OR SALARY >= 6500;
+----+----------+-----+-----------+----------+
| ID | NAME | AGE | ADDRESS | SALARY |
+----+----------+-----+-----------+----------+
| 1 | Ramesh | 32 | Ahmedabad | 2000.00 |
| 2 | Khilan | 25 | Delhi | 1500.00 |
| 4 | Chaitali | 25 | Mumbai | 6500.00 |
| 5 | Hardik | 27 | Bhopal | 8500.00 |
| 7 | Muffy | 24 | Indore | 10000.00 |
+----+----------+-----+-----------+----------+
5 rows in set (0.00 sec)
TUTORIALS POINT
Simply Easy Learning
| 2 | Khilan | 25 | Delhi | 1500.00 |
| 4 | Chaitali | 25 | Mumbai | 6500.00 |
| 5 | Hardik | 27 | Bhopal | 8500.00 |
+----+----------+-----+---------+---------+
3 rows in set (0.00 sec)
TUTORIALS POINT
Simply Easy Learning