DELETE Statement Examples

SQL statement

Description

 

DELETE FROM Employees
WHERE Title = 'Trainee';

Deletes all records for employees whose title is Trainee.  When the FROM clause includes only one table, you don't have to list the table name in the DELETE statement.

DELETE
FROM Employees, Payroll,
Employees
INNER JOIN Payroll
ON Employees.[Employee ID] = Payroll.[Employee ID]
WHERE Title = 'Trainee';

Deletes all records for employees whose title is Trainee and who also have a record in the Payroll table.  The Employees and Payroll tables have a one-to-one relationship.