Use the DELETE statement to delete data from the table. The syntax of the DELETE statement is: DELETE FROM table_name WHERE condition; where table_name is the table name and condition is an optional filter condition. If no condition is specified, all records in the table are deleted.
Command to delete table in SQL
In SQL, you can use the DELETE statement to delete data in the table . The syntax of the DELETE statement is as follows:
DELETE FROM table_name WHERE condition;
where:
table_name
is the name of the table to delete datacondition
is optional and is used to specify the rows to be deletedExample
To delete all records in thecustomers
table, You can use the following statement:
DELETE FROM customers;
To delete records that meet specific conditions in thecustomers
table, you can use the following statement:
DELETE FROM customers WHERE age > 30;
Notes
The above is the detailed content of command to delete table in sql. For more information, please follow other related articles on the PHP Chinese website!