SQL DELETE Statement
The DELETE Statement
The DELETE statement is used to delete rows in a table.
Syntax
DELETE FROM table_name
WHERE column_name = some_value
|
Person:
| LastName |
FirstName |
Address |
City |
| Nilsen |
Fred |
Kirkegt 56 |
Stavanger |
| Rasmussen |
Nina |
Stien 12 |
Stavanger |
Delete a Row
"Nina Rasmussen" is going to be deleted:
DELETE FROM Person WHERE LastName = 'Rasmussen' |
Result
| LastName |
FirstName |
Address |
City |
| Nilsen |
Fred |
Kirkegt 56 |
Stavanger |
Delete All Rows
It is possible to delete all rows in a table without deleting the table. This
means that the table structure, attributes, and indexes will be intact:
DELETE FROM table_name
or
DELETE * FROM table_name
|
Use a web development platform that will help you save a lot of time and bring excitement to your daily development work.
It will also create professional best-practices around your code development and team collaboration.
Try Springloops now, the web development platform
|