SQL DELETE Statement

The SQL DELETE statement is used to delete data from a table. We can use it to delete all records in a row or multiple rows of a table.

SQL DELETE statement

DELETE FROM table_name

WHERE column_name = value

When more than one row has the same value for a column, we can use the AND operator to specify additional column with value that is distinct. Just like below.

DELETE FROM table_name

WHERE column_name = value AND column_name = value


Database Table “Members”

Id FirstName LastName Email City Phone
1 Gilbert Duncan [email protected] Newark 973-600-3300
2 Elvis Daniels [email protected] Piscataway 862-600-3050
3 Michael Green [email protected] Detroit 732-500-5050
4 Kelvin Graham [email protected] Detroit 732-555-5050
5 Helsinko Getauchi [email protected]

SQL DELETE Example

DELETE FROM Members

WHERE FirstName=’Helsinko’ AND LastName=’Getauchi’

RESULT of SQL DELETE statement above will be

Id FirstName LastName Email City Phone
1 Gilbert Duncan [email protected] Newark 973-600-3300
2 Elvis Daniels [email protected] Piscataway 862-600-3050
3 Michael Green [email protected] Detroit 732-500-5050
4 Kelvin Graham [email protected] Detroit 732-555-5050

Important: Please be very careful when using the SQL DELETE statement. Make sure you specify what specific rows need to be updated by using the WHERE clause to restrict the row(s) because otherwise the rows of the table will be deleted if no row is specified.