MYSQL DROP TABLE Query

The DROP TABLE Query is used to drop an existing table in a database. We cannot recover the lost data after droping table.

MYSQL Syntax:
DROP TABLE table_name;

MYSQL Example :
DROP TABLE tblstudent;

As per as above example, tblstudent will be deleted from database.
DROP TABLE clause is used to delete table with the whole structure or definition permanently from the database.
We can delete more than one table from the database at time as below.
DROP TABLE IF EXISTS table_name1, table_name2, ......,table_nameN

Difference MySQL TRUNCATE Table and  DROP Table (TRUNCATE vs. DROP).

  • DROP TABLE Query is used to delete complete table with data and structure both. TRUNCATE TABLE removes only table data but it will not delete structure.

 

 

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

33179