SQL DELETE

The DELETE statement is used to delete rows from a table.

SQL DELETE syntax is:

DELETE FROM tablename WHERE columnName = value

If you want to delete all records or rows in a table, use the statement:

DELETE * FROM tablename;

Example of SQL DELETE to delete a row in the table people

namesurnamenickname
HARRYCLARKWHITE
WILLIAMJONESCLARK
HARRYSMITHJOHNSON
JOHNBROWNANDERSON

If we delete the individual JONES WILLIAM CLARK, we can execute the command:

DELETE FROM people WHERE name = 'WILLIAM' AND surname = 'JONES' AND nickname = 'CLARK'

The table 'people' result will be:

namesurnamenickname
HARRYCLARKWHITE
HARRYSMITHJOHNSON
JOHNBROWNANDERSON