MySQL DELETE

Last Updated: March 11, 2022

To remove a record from a table DELETE command can be used.

DELETE Syntax

DELETE FROM table_name WHERE condition;

Do not forget to include the WHERE clause otherwise, it will delete all the records of the table

Example

Delete all employees with salaries greater than 80000

DELETE FROM employees WHERE salary > 80000

Delete condition can be a subquery

Test