Home > Daily Programming > Mysql Knowledge > Command to delete table in mysql

Command to delete table in mysql

下次还敢
Release: 2024-04-27 08:42:17
Original
718 people have browsed it

Use the DROP TABLE command to delete a MySQL table. Syntax: DROP TABLE table_name;. Example: Drop a table named employees: DROP TABLE employees;. Note: Deleting a table will permanently delete all data, please make sure to back it up.

Command to delete table in mysql

MySQL delete table command

How to delete a MySQL table?

Use the DROP TABLE command to delete a MySQL table.

Syntax:

<code class="sql">DROP TABLE table_name;</code>
Copy after login

Parameters:

  • table_name: The table to be deleted The name.

Example:

To delete the table named employees, use the following command:

<code class="sql">DROP TABLE employees;</code>
Copy after login

Note:

  • Deleting a table will permanently delete all data in the table.
  • Make sure you have backed up the data before deleting the table.
  • If the table has foreign key constraints, these constraints must be dropped before dropping the table.
  • You can only delete tables that you have permission to delete.

The above is the detailed content of Command to delete table in mysql. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template