OR condition in SQLite

SQLite OR
To make multiple comparisons with different operators in the same statement, the SQLite OR clause is used. It is generally used with SELECT, UPDATE and DELETE statements. In the case of OR operation, if any of the given condition is true, the complete condition is considered true. It is always used with the WHERE Clause.

Syntax:

SELECT column_1, column_2, column_N   
FROM table_name  
WHERE condition_1 OR condition_2...OR condition_N;   

Example:
TEACHERS Table:

IDNAMEAGESUBJECT
1Jim27English
2John30Geology
3Watson28French
4Holmes40Chemistry
5Tony35Physics
SELECT * FROM TEACHERS
WHERE ID > 2 OR AGE >= 30;

Output:

IDNAMEAGESUBJECT
2John30Geology
3Watson28French
4Holmes40Chemistry
5Tony35Physics

Explanation:
The “TEACHERS” is an already existing table. Here we are selecting those rows of the table where either the value in the ID column is greater than 2 or the value in the AGE column is greater than or equal to 30 or where both the conditions are true.

Please Share