SQL Keyword - AND

AND Keyword

The AND keyword, or operator, is used with the where clause when we want to check multiple conditions and want them to all be true.

The AND operators are used to filter records based on more than one condition and need all conditions to be true.

Syntax

SELECT <COLUMNS> FROM <TABLE_NAME> WHERE <CONDITION_1> AND <CONDITION_2>
DELETE FROM <TABLE_NAME> WHERE <CONDITION_1> AND <CONDITION_2>
UPDATE <TABLE_NAME> SET <COLUMN_NAME> = <VALUE> WHERE <CONDITION_1> AND <CONDITION_2>

Example

SELECT * FROM Employee WHERE Emp_Salary > 50000 AND Emp_Dept = 'Accounts'
DELETE FROM Employee WHERE Emp_Salary > 50000 AND Emp_Dept = 'Accounts'
UPDATE Employee  SET Emp_Salary = Emp_Salary + 5000 WHERE Emp_Salary > 50000 AND Emp_Dept = 'Accounts'

Summary

The AND Keyword or Operator is used when we want to check more than one condition and also whether all are true.