# DROP TABLE: delete tables

TIP

Run through and play with the interactive database[1] for this lecture to learn about this better!

If you ever want to delete an entire table and all its data, you can use DROP TABLE[2]:

DROP TABLE entries;

There's really not much to it, other than be careful that it is what you want to do! Data is non-recoverable.

You'll get an error if you try to drop a table that doesn't exist.

To avoid the error, try this:

DROP TABLE IF EXISTS entries;

  1. Interactive database for this lecture (opens new window) ↩︎

  2. DROP TABLE in SQLite (Official Documentation) (opens new window) ↩︎