MySQL - DROP TABLE

mysql

How can we drop a table?

DROP TABLE table_name;

How can we drop multiple tables?

In MySQL, a single DROP TABLE statement can be used to drop multiple tables:

DROP TABLE t1, t2, t3;

How can we drop a table only if it exists?

DROP TABLE [IF EXISTS] t1;

The [IF EXISTS] clause prevent MySQL from generating an error message.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License