DELETE
Statement
DELETE
statement is used to delete rows in a table.
The syntax of a delete statement is on the right. |
|
LastName | FirstName | Address | City |
---|---|---|---|
Hansen | Ola | Timoteivn 10 | Sandnes |
Svendson | Tove | Borgvn 23 | Sandnes |
Pettersen | Kari | Storgt 20 | Stavanger |
Rasmussen | Nina | Stien 12 | Stavanger |
SQL> delete from Persons where LastName = 'Rasmussen'; 1 row deleted. SQL> delete from Persons; 3 rows deleted. |
LastName | FirstName | Address | City |
---|---|---|---|
Hansen | Ola | Timoteivn 10 | Sandnes |
Svendson | Tove | Borgvn 23 | Sandnes |
Pettersen | Kari | Storgt 20 | Stavanger |
Persons
table without deleting the table.
This means that the table structure, attributes, and indexes will be intact.
LastName | FirstName | Address | City |
---|
Customers
table may be created by the following command:
SQL> create table Customers ( 2 CustomerID varchar(16), 3 CompanyName varchar(32), 4 ContactName varchar(32), 5 Address varchar(64), 6 City varchar(32), 7 PostalCode varchar(16), 8 Country varchar(32) );Note that the
Customers
table is for read only.