Node.js MySQL Delete Records

Node.js MySQL Delete Query helps you to delete one or more records from a table based on a filtering condition.

Node.js MySQL – Delete Records from a Table based on a condition

Execute DELETE FROM query on specified table with filter applied on one or many properties of records in the table.

Observe that in the result, affectedRows is 6, which means six records have been deleted.

Following are the records left after executing MySQL DELETE FROM query on students table.

Node.js MySQL – Delete All Records from a Table

Following are the contents of students table after execution

Conclusion :

In this Node.js TutorialNode.js MySQL – DELETE FROM, we have learnt to delete records based on a condition or delete all the records from the table.