The SQL DELETE Query is used to delete the existing records in a database table.
DELETE Query with Where
Syntax of DELETE Query in SQL
DELETE FROM table_name WHERE condition;
Example OF SQL DELETE QUERY
The following SQL statement deletes the T4Tutorials_Name”Asad” from the “Customers” table:
DELETE FROM fee WHERE T4Tutorials_Name=’Asad’;
This query will delete the full row of T4Tutorials_RollNo=16.
DELETE Query to Delete All the Records
It is possible to delete all the rows and data in a table without deleting the table, table structure, table attributes, and indexes.
DELETE FROM table_name;
The following SQL query deletes all the rows in the “fee” table, without deleting the table,table structure, table attributes, and indexes.
Example of SQL Query to Delete All the Records in a table
DELETE FROM fee;
This query will delete the data of full table.