DELETE¶
The DELETE statement is used to remove records from a table. You can delete a single row, multiple rows, or all rows at once based on specific conditions.
Basic DELETE Syntax¶
To delete records from a table, use the following syntax:
If you want to delete all records from a table, you can omit the WHERE clause:
Examples¶
Consider the following Foo table:
With the following records:
Deleting Records with a WHERE Clause¶
To delete records that meet a specific condition, use the WHERE clause:
After executing the above query, the remaining records in the Foo table will be:
Deleting All Records¶
To delete all records from a table, omit the WHERE clause:
After executing the above query, the Foo table will be empty: