SQLite’s DROP TABLE Statement is used to delete the table definition and all related data, indexes, triggers, constraints, and permission specifications for the table.
Be careful when using this command, because once a table is deleted, all information in the table will be lost forever. The basic syntax of the DROP TABLE statement is as follows. You can choose to specify a database name with a table name, as follows: Let’s first confirm that the COMPANY table already exists, and then we delete it from the database. This means that the COMPANY table already exists in the database, so let’s delete it from the database as follows: Now, if you try the .tables command, you will not be able to find the COMPANY table: The display result is empty, which means that the table has been successfully deleted from the database. 1.11.1. Grammar ¶
DROP TABLE database_name.table_name;
1.11.2. Example ¶
sqlite>.tables
COMPANY test.COMPANY
sqlite>DROP TABLE COMPANY;
sqlite>
sqlite>.tables
sqlite>