To delete a table in MySQL, use the DROP TABLE command. This command will permanently delete the table and its data. Data should be backed up before use. Before dropping a table, you need to drop foreign key constraints and other objects that reference the table.
Delete table in MySQL
DROP TABLE
command is used to delete the table in MySQL database surface.
Syntax:
<code>DROP TABLE table_name;</code>
Parameters:
table_name
: The table to be deleted The name. Example:
Deleting a table named users
:
<code>DROP TABLE users;</code>
Important:
DROP TABLE
command will permanently delete the table and all its data. Please make sure you have backed up your data before deleting the table. The above is the detailed content of The command to delete a table in mysql is. For more information, please follow other related articles on the PHP Chinese website!