Structured Query Language/DELETE 1

Hint: Be careful and deactivate AUTOCOMMIT.

The DELETE command removes rows from a table.

The syntax is straightforward as we do not need to specify any column name - rows are deleted as a whole and not partly. As usual, the search condition specifies the criterion which identifies the affected rows. It can involve zero, one, or more rows. If we omit the WHERE keyword and the search condition all rows are affected.

Example
The information about Mr. Burton was deleted and restored again.

Further Information
We present some more information about the DELETE command here. There are also some comments to the interconnection with the TRUNCATE command.

Exercises
Delete the hobby 'Yoga'.

Delete all relations between persons and hobbies. Check result. Restore all rows.