O'Reilly logo

SQL: Visual QuickStart Guide by Chris Fehily

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required