Drop multiple MySQL tables
Posted September 23rd, 2009 in MySql
Last week I looked at how to drop a table with MySQL showing how to do this with a query and then using the phpMyAdmin web based interface. This time I will show how to drop multiple tables with a single query and then how to do the same with phpMyAdmin.
SQL Query
Dropping multiple tables is the same as dropping a single table; additional tables are added to the DROP TABLE query in comma separated fashion. Note that running the following query to delete the example categories, products and orders table is irrecoverable and there is no prompting.
DROP TABLE categories, orders, products;
Using phpMyAdmin
To drop multiple tables in phpMyAdmin select the page which shows all the tables for a database. Tick the boxes for the tables you want to delete, and select "Drop" from the "With selected:" drop down box. This is shown in the screenshot below where all three tables have been checked: categories, orders and products.

The page will submit and a confirmation page will display asking if you really do want to drop those tables. Click "Yes" and they will be dropped.

Related posts:
- MySQL: SQL to drop a column from a table (Wednesday, November 25th 2009)
- How to drop a table with MySQL (Wednesday, September 16th 2009)
- How to drop a database with MySQL (Wednesday, September 9th 2009)
Share or Bookmark
Share or Bookmark this page using the following services. You will need to have an account with the selected service in order to post links or bookmark this page.
Subscribe or Follow
Subscribe via RSS or email, or follow me on Facebook or Twitter below. The RSS icon takes you through to Feedburner where you can select the service or application to use.

