Name
DROP TABLE
-- Removes a table from a database
Synopsis
DROP TABLE name [, ...]
Parameters
- name
The sole parameter of this command is the name of an existing table you wish to drop.
Results
- DROP
This message is displayed if the table is dropped successfully.
- ERROR: table "name" does not exist!
This error is displayed if the specified table or view does not exist in the database.
Description
Use the DROP TABLE to remove tables and views from the database.
You must be the owner of the table you specify as the table to drop when using this command.
| Clearing a Table |
---|
| To empty a table (as opposed to completely deleting it), use the delete
command.
|
Any secondary indexes on the table will be removed before anything else. The act of removing a secondary
index does not have any direct affect upon the contents of a table.
Examples
Use the following example to remove the employees table.
DROP TABLE employees;