SQL - DELETE Statement

In the database structured query language (SQL), the 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.


The general syntax is:

DELETE FROM table_name [WHERE condition]

DELETE FROM table_name tells MySQL server to remove all the rows from the table, and [WHERE condition] is optional and is used to put a filter that restricts the number of rows affected by the DELETE query. If the WHERE clause is not used in the DELETE query, then all the rows in a given table will be deleted.