The OR logical operator returns true when at least one of its connected conditions is true.
OR is useful when a business requirement allows multiple possible conditions or categories.
Find employees working in either IT or Finance.
SELECT
EmployeeName,
Department
FROM Employees
WHERE Department = 'IT'
OR Department = 'Finance';
OR is used for category filtering, exception rules, customer segmentation, and multi-option business criteria.
- OR combines alternative conditions.
- At least one condition must be true.
- It can broaden a result set.
- Multiple OR conditions can be combined.
- IN can sometimes simplify repeated equality conditions.
What does OR do in SQL?
OR returns true when at least one connected condition is true.
How can repeated OR conditions sometimes be simplified?
Multiple equality checks on the same column can often be replaced with the IN operator.