EB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

SQL DELETE Statement


The DELETE statement is used to remove data from your table.


The SQL DELETE Statement

The DELETE statement is used to remove row from your table.

SQL DELETE Syntax

DELETE FROM table_name
WHERE condition ;

Database

In this tutorial we can use the well-known sample database.

Below is a selection from the "Customers" table:

CustomerID FirstName Phone Birthday Age
1

Giovanna Hoefnagel 0492 91 01 09 June 1, 1983 35 years old
2 Santino Alberto 0495 17 50 11 February 22, 1955 63 years old
3 Thor Weeda 0473 39 08 76 June 22, 1941 76 years old
4

Ivette van Vreeswijk 0484 84 43 94 May 19, 1993 28 years old
5 Joao Maasland 0484 84 25 36 January 22, 1985 33 years old

SQL DELETE Example

Assume we can delete the FirstName "Joao Maasland" from the "Customers" table.

We use the following SQL statement:

Example

DELETE FROM Customers
WHERE FirstName='Joao Maasland' AND FirstName='Santino Alberto';

The "Customers" table will now look like this:

CustomerID FirstName Email Address Username Password
2 Darrell C. Witmer DarrellCWitmer@teleworm.us Dina1954 waej6Weal8us
3 Donald M. Marquis DonaldMMarquis@armyspy.com Whoundle1958 Yoh3eeJooh
4

Michael I. Funk MichaelIFunk@armyspy.com Nevolly72 ohH2EJa3
5 Barbara G. Greer BarbaraGGreer@jourrapide.com Aftearany weduuLae1

Delete All Data

The DELETE statement removes the data from the table permanently.:

DELETE FROM table_name;

or

DELETE * FROM condition; ;