DROP TABLE


 

SQLite: DROP TABLE/DATABASE Statement

This SQLite tutorial explains how to use the SQLite DROP TABLE/DATABASE statement with syntax and examples.

 

Description:

  • The SQLite DROP TABLE statement allows you to remove or delete a table from the SQLite database.
  • The SQLite DROP DATABASE statement is used to delete a database.

 

Syntax:

DROP TABLE syntax:

 

Parameters or Arguments:

table_name

The name of the table to remove from the database.

IF EXISTS

Optional. If specified, the DROP TABLE statement will not raise an error if one of the tables does not exist.

Note: If you use the SQLite DROP TABLE statement to drop a table that does not exist, the database will raise an error (unless you specify the IF EXISTS parameter in the DROP TABLE statement).
DROP DATABASE syntax:

 

Parameters or Arguments:

database_name

The name of the database to delete.

 

Examples:

The Following SQLite statement drop the account table from the database: