SQLite – DROP TABLE Statement




SQLite
SQLite
SQLite – DROP TABLE Statement

SQLite – DROP TABLE Statement

In SQLite the DROP TABLE Statement can be used to drop/delete the table in a database.

The DROP TABLE statement not only will remove your table but also all the data, triggers, indexes, constraints and permissions for the table.

Note: While using DROP TABLE statement we need to be careful because once the table is removed all the data related to the table will also be lost.

SQLite DROP TABLE Syntex

The syntex for dropping a table from the database using SQLite is shown below:

DROP TABLE table_name;

Example:

So let’s consider we have created SCHOOL database. And we also created two tables called STUDENTS and TEACHERS in this database.

sqlite>.tables
STUDENTS     TEACHERS

So in order to drop the STUDENTS table you be to execute the following command.

sqlite>DROP TABLE STUDENTS;
sqlite>
);

Now if we list down all the tables in the database again using .tables command, we will see the following result.

sqlite>.tables
TEACHERS


Partner Sites

VideoToGifs.com

EasyOnlineConverter.com

SqliteTutorials.com





Be the first to comment

Leave a Reply

Your email address will not be published.


*