SQLite Drop Table
SQLite'sDROP TABLEThe statement is used to delete the table definition and all its related data, indexes, triggers, constraints, and permission specifications for that table.
Special attention should be paid when using this command, because once a table is deleted, all information in the table will be lost forever.
Syntax
The basic syntax of the DROP TABLE statement is as follows. You can optionally specify the database name along with the table name, as shown below:
DROP TABLE database_name.table_name;
Example
Let us first confirm that the COMPANY table already exists, and then we will drop it from the database.
sqlite>.tables COMPANY test.COMPANY
This means that the COMPANY table already exists in the database. Next, let us drop it from the database, as follows:
sqlite>DROP TABLE COMPANY; sqlite>
Now, if you try the .TABLES command, you will not be able to find the COMPANY table:
sqlite>.tables sqlite>
The displayed result is empty, meaning that the table has been successfully dropped from the database.
Other Extensions