The statement to delete a table in SQL is DROP TABLE table_name, where table_name is the name of the table to be deleted. For example, DROP TABLE customers will delete the table named "customers". Please note that deleting a table will permanently delete all data, so be sure to back up before doing so. In addition, if there are foreign key references, the foreign key constraints need to be deleted first, and deleting large tables may take a long time.
SQL statement to delete a table
In SQL, use the DROP TABLE
statement Delete a table. The syntax is as follows:
<code>DROP TABLE table_name;</code>
where table_name
is the name of the table to be deleted.
Execution Example
The following example deletes the table named "customers":
<code>DROP TABLE customers;</code>
Notes
The above is the detailed content of Statement to delete a table in sql. For more information, please follow other related articles on the PHP Chinese website!