Deprecated: mysql_query(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/sqldump/public_html/config.php on line 184

Warning: mysql_query(): Access denied for user ''@'localhost' (using password: NO) in /home/sqldump/public_html/config.php on line 184

Warning: mysql_query(): A link to the server could not be established in /home/sqldump/public_html/config.php on line 184
SQL DELETE tutorial and delete from database query examples

SQL statement: DELETE

The DELETE command simply removes data from the database table. The general syntax for deleting a row or multiple rows is the following, using our Custoemrs example from the previous tutorials:

DELETE FROM Customers WHERE FirstName = 'Joe'

This query will simply remove the new rows we insterted previously in the tutorial - all customers called 'Joe'.

Using the DELETE command, you can easily remove all the content from an SQL database using the following:

DELETE FROM Customers

So it is always important to use a WHERE clause unless you want to empty the table!

Back to table of contents