mysql

Remove or drop table MySQL

Here we are showing how you can remove a table from the database.

-- Remove single table
DROP TABLE table_name;

-- Remove multiple tables
DROP TABLE table_name_1, table_name_2;

DROP TABLE statement removes an existing table from an existing database. This will also delete whole data that is inserted into that table.

To run this query the table must exist inside the database. If the table does not exist the query will display the error. To add a check of table exist then drop the table is as below

DROP TABLE IF EXISTS table_name;
Was this helpful?