OR Clause
The OR opertor in sql is used to distinguish between two query to one query for a result. In this operator you need only one codition to be true then return the result.
Syntax:
SELECT column1
FROM table_name
WHERE condition 1
OR condition 2;
Example:
Teacher
c_id |
c_name |
c_age |
c_experince |
01 |
Baithy |
37 |
7 |
02 |
Lennin |
27 |
2 |
03 |
Shaun |
41 |
6 |
04 |
Peter |
29 |
3 |
05 |
Mike |
44 |
8 |
SELECT * from teacher
WHERE age>30 OR experience>5;
It would produce the following output:
c_id |
c_name |
c_age |
c_experince |
01 |
Baithy |
37 |
7 |
03 |
Shaun |
41 |
6 |
05 |
Mike |
44 |
8 |