The SQL AND & OR operators are used to combine multiple conditions to narrow data in an SQL statement. These two operators are called as the conjunctive operators.
These operators provide a means to make multiple comparisons with different operators in the same SQL statement.
The AND operator allows the existence of multiple conditions in an SQL statement's WHERE clause.
The basic syntax of the AND operator with a WHERE clause is as follows −
You can combine N number of conditions using the AND operator. For an action to be taken by the SQL statement, whether it be a transaction or a query, all conditions separated by the AND must be TRUE.
The OR operator is used to combine multiple conditions in an SQL statement's WHERE clause.
The basic syntax of the OR operator with a WHERE clause is as follows −
You can combine N number of conditions using the OR operator. For an action to be taken by the SQL statement, whether it be a transaction or query, the only any ONE of the conditions separated by the OR must be TRUE.