/    /  MySQL – DROP Table

MySQL – DROP Table

 

MySQL - DROP Table

In MySQL, an existing table is deleted using the Drop Table statement. This statement removes the entire data of a table, along with its entire structure or definition, from the database permanently. It is critical that you be extremely careful when deleting a table, as we are unable to recover the data once it has been removed.

Syntax:

In MySQL, the following syntax is used to remove the table:

DROP TABLE table_name;

Example:

DROP TABLE employees;

MySQL - DROP Table

DROP TABLE if exists employees;

Using the IF EXISTS clause with the DROP TABLE statement results in the following error message from MySQL:

MySQL - DROP Table