Use the DROP TABLE command to remove an existing table from a database.
DROP TABLE <table>[,<table>…] [IF EXISTS]
|The name of the table to be dropped.
|If the specified table name does not exist in
the current database and schema, the DROP TABLE command does not throw
an error. Unless other conditions such as dependencies prevented the
drop operation, the command returns a DROP TABLE message even though
it did not drop a table. This option causes the command to ignore
the failure condition when the table does not exist.
This option is typically used for scripted applications that are running SQL commands, and you want to suppress the "table not found" error message so that it does not impact or halt the application.
|The table was successfully dropped.
|ERROR: Relation "name" does not exist
|The specified table does not exist in the database. If you specify IF EXISTS, this error condition is ignored. The command appears to complete successfully even though it did not drop a table.
You must be the admin user, the owner of the user, or your account must have the Drop privilege for the user who is the owner of the table or for the User object class.
- To drop the tables
MYDB.SCH1(USER)=> DROP TABLE films, distributors;