Python MySQL Drop Table

Python MySQL Drop Table

Delete a Table

You can delete an existing table by using the “DROP TABLE” statement:

Example

Delete the table “customers”:

Run example »


Drop Only if Exist

If the table you want to delete is already deleted, or for any other reason does not exist, you can use the IF EXISTS keyword to avoid getting an error.

Example

Delete the table “customers” if it exists:

Run example »

ArmenianEnglish