WHERE clause with logical operators
WHERE [NOT] search_condition_1 {AND|OR} [NOT] search_condition_2 ...
AND operator
WHERE categoryID = 1 AND discountPercent = 30
OR operator
WHERE categoryID = 1 OR discountPercent = 30
NOT operator
NOT listPrice >= 500
NOT operator
WHERE listPrice < 500
SELECT productName, listPrice, discountPercent, dateAdded
FROM products
WHERE dateAdded > '2017-07-01' OR listPrice < 500
AND discountPercent > 25;
SELECT productName, listPrice, discountPercent, dateAdded
FROM products
WHERE (dateAdded > '2017-07-01' OR listPrice < 500)
AND discountPercent > 25;
AND and OR logical operators to create compound conditions that consist of two or more conditions. You use the AND operator to specify that the search must satisfy both of the conditions, and you use the OR operator to specify that the search must satisfy at least one of the conditions.NOT operator to negate a condition.NOT, (2) AND, and (3) OR. You can use parentheses to override this order of precedence or to clarify the sequence in which the operations will be evaluated.