Logical operators
You can combine two or more conditions. The conditions must be related by AND
or OR
, such as:
Copy
salary = 40000 AND exempt = 1
The logical NOT operator is used to reverse the meaning, such as:
Copy
NOT (salary = 40000 AND exempt = 1)
Copy
SELECT * FROM Sales_Data WHERE Sales_Data.Company_Name
NOT LIKE '%University' AND Sales_Data.Amount > 3000
SELECT * FROM Sales_Data WHERE (Sales_Data.Company_Name
LIKE '%University' OR Sales_Data.Amount > 3000)
AND Sales_Data.Salesperson_ID = 'SP-1'