The DELETE statement is used to delete rows in a table.
Syntax
DELETE FROM table_name WHERE column_name = some_value
Person:
+----------+-----------+--------+-------------+ | LastName | FirstName | Number | DateOfBirth | +----------+-----------+--------+-------------+ | 'Smith' | 'John' | 1 | 1980-01-01 | | 'Doe' | 'John' | 1 | 1980-01-01 | | 'Blair' | 'James' | 8 | 1953-05-06 | +----------+-----------+--------+-------------+
John Doe
is going to be deleted:
DELETE FROM Person WHERE LastName = 'Doe'
Result
+----------+-----------+--------+-------------+ | LastName | FirstName | Number | DateOfBirth | +----------+-----------+--------+-------------+ | 'Smith' | 'John' | 1 | 1980-01-01 | | 'Blair' | 'James' | 8 | 1953-05-06 | +----------+-----------+--------+-------------+
It is possible to delete all rows in a table without deleting the table. This means that the table structure and attributes will be intact:
DELETE FROM table_name
Result
+----------+-----------+--------+-------------+ | LastName | FirstName | Number | DateOfBirth | +----------+-----------+--------+-------------+ +----------+-----------+--------+-------------+