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:
<code class="sql">DELETE FROM table_name WHERE condition;</code>
where:
table_name
is the name of the table to delete datacondition
is optional and is used to specify the rows to be deleted Example
To delete all records in the customers
table, You can use the following statement:
<code class="sql">DELETE FROM customers;</code>
To delete records that meet specific conditions in the customers
table, you can use the following statement:
<code class="sql">DELETE FROM customers WHERE age > 30;</code>
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!