SQL Strategy - A site to master SQL while executing it on the Web
Home >> SQL Strategy - DELETE statement

Deletion of records DELETE statement

The DELETE statement is used to delete records in a Table.

1.How to use the DELETE statement

--DELETE statement syntax (1)
DELETE FROMTable Name
WHEREconditions

When using the DELETE statement, DELETE FROM is followed by the Table Name that contains the record to be deleted. The condition of the record to be deleted is specified in the WHERE field, and the DELETE statement deletes all records matching the WHERE condition; if no WHERE condition is specified, all records are deleted.

If you want to delete all employee records, do the following

DELETE FROMEMP

To delete the record of Mr. SMITH (Employee Number:7369) in the EMP Table, the following will be used.

DELETE FROMEMP
WHEREEMPNO = 7369

This completes the DELETE statement.