AND — Combine Multiple Conditions
The AND keyword in SQL allows you to combine multiple conditions in a WHERE clause. All conditions must be true for a row to be included in the result.
Syntax
SELECT column1, column2 FROM table_name
WHERE condition1 AND condition2 AND ....;
Example 1: Employees in IT and older than 30
SELECT name, age, department FROM employees
WHERE department = 'IT' AND age > 30;
This returns only those employees who are both in the IT department and older than 30.
Example 2: Employees in Sales and female
SELECT name, gender, department FROM employees
WHERE department = 'Sales' AND gender = 'female';
This filters employees based on two criteria at the same time.
Use AND when all conditions must be true.
If even one condition is false, the row will not appear in the result.
Combining conditions with AND helps you build more precise queries that target exactly the data you need.