Skip to content

DML: Delete

Deleting a row from a table is similar to updating a row in that the require record is also identified using a WHERE clause. The same warnings therefore apply - make sure that you are deleting the correct row(s) before you actually make the change. If a copy of a book is lost, for example, we might want to delete it from the database. This could be done using the following statement:

    DELETE FROM copy
    WHERE  copy_id = 1200;

The FROM keyword is actually optional, but it makes the DELETE statement a little more natural.

Further reading


The SQL DELETE Statement