Deleting Data

To delete (remove) data from a table, the DELETE statement is used. DELETE can be used in two ways:

  • To delete specific rows from a table

  • To delete all rows from a table

You'll now take a look at each of these.

Don't Omit the WHERE Clause Special care must be exercised when using DELETE because it is all too easy to mistakenly delete every row from your table. Please read this entire section on DELETE before using this statement.

DELETE and Security Use of the DELETE statement might require special security privileges in client-server ...

Get Sams Teach Yourself SQL in 10 Minutes, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.