Dropping a table

You can remove an existing table by issuing a DROP TABLE statement.

Ensure that if you are removing a table, you do not break the current hierarchy of the database. Additional modifications to your database may be needed in order for your DROP TABLE to be valid. It is recommended if you are changing the hierarchy of your database that you create a new database with similar attributes instead.

Procedure

  1. Issue an ALTER DATABASE statement to identify the database in which you plan to modify.
  2. Issue a DROP TABLE statement. Ensure that you also provide the IN keyword to reference it to the database it belongs to.
  3. Issue additional DROP TABLE statements for any child tables that you do not want to keep.
  4. Issue any ALTER TABLE statements to change the FOREIGN KEYs of any affected tables in the hierarchy.
  5. Issue a COMMIT DDL statement.