English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

SQLite Delete Table (DROP TABLE)

SQLite DROP TABLEThe statement is used to delete the table definition and all associated data, indexes, triggers, constraints, and permission specifications of the table.

Be careful when using this command because once the table is deleted, all available information in the table will be permanently lost.

Syntax

The following is the basic syntax of the DROP TABLE statement. You can specify the database name and table name as shown below:

DROP TABLE database_name.table_name;

Online Examples

Let's first verify the COMPANY table and then delete it from the database.

sqlite>.tables
COMPANY       test.COMPANY

This means the COMPANY table is available in the database, so let's delete it as follows-

sqlite>DROP TABLE COMPANY;
sqlite>

Now, if you try to use the .TABLES command, you will no longer find the COMPANY table.

sqlite>.tables
sqlite>

It did not display anything, which means the table has been successfully deleted from the database.