by Dinesh Thakur Category: SQL Tutorials

The DELETE statement is used to delete rows in a table. To do so, we can use the DELETE FROM command. An SQL DELETE statement removes one or more records from a table. A subset may be defined for deletion using a condition, otherwise all records are removed.

Executing a DELETE statement may cause triggers to run that may cause deletes in other tables. For example, if two tables are linked by a foreign key and rows in one table were deleted, then it is common that rows in the second table would also have to be deleted to maintain referential integrity.

Delete from <table> [where <condition>];



Delete all tuples that have been finished before the actual date (system date):

Delete from EMP where hiredate < sysdate;


• Now we will delete the record whose roll=2214 from the stu table.



1 row deleted.

Now we will delete all the records from the stu table.


Note: Notice the WHERE clause in the DELETE syntax. The WHERE clause specifies which record or records that should be deleted. If you omit the WHERE clause, all records will be deleted!

Related SQL

About Dinesh Thakur
