Removing Tables

The command to remove a table from a database is DROP TABLE:

DROP TABLE table_name

When you issue this command, you remove the specified table from the database, together with its contents.

If you want to keep the table structure but remove all of its data, use the DELETE command (more about it later in this chapter).

Get Practical SQL Handbook, The: Using SQL Variants, Fourth 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.