Dropping a Table with DROP TABLE
Use the DROP TABLE statement to remove a table from a database. When you’re dropping a table, some important considerations are:
You can drop a base table or a temporary table.
A dropped table is gone forever. You can’t undo or roll back a DROP TABLE statement.
Dropping a table destroys its structure, data, indexes, constraints, permissions, and so on.
Dropping a table isn’t the same as deleting all its rows. You can empty a table of rows, but not destroy it, with DELETE FROM table;. See “Deleting Rows with DELETE” in Chapter 9.
Dropping a table doesn’t drop views that reference that table; see Chapter 12.
You’ll encounter problems with foreign keys or views that reference a dropped table unless they’re altered or ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access