Database IntegrationLesson 54Free preview
MySQL Delete
This lesson is part of Node.js · All levels
Summary
The DELETE command deletes the row from the table based on the WHERE condition you specify. Without WHERE, the entire line is deleted so it must be written very carefully. In the production app, consider soft delete by marking the status column instead of deleting physical data.
Key points
- DELETE FROM the table WHERE the condition deletes the selected row
- Without WHERE, all the rows in the table are deleted
- AffectedRows informs the number of rows deleted
- Soft delete is often safer for auditing
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.