MySQL DatabaseLesson 68Free preview
MySQL Delete Data
This lesson is part of PHP · All levels
Summary
The DELETE FROM command deletes the data line from the table, and the WHERE clause specifies which line is deleted. Without WHERE, the entire contents of the table will be lost, so be very careful. Compare the DELETE that deletes content to the DROP TABLE that deletes the structure of the table itself.
Key points
- DELETE FROM the WHERE table the condition deletes the line that meets the condition.
- Without WHERE, all the lines are deleted so it's imperative to be careful.
- DELETE deletes per line and can be canceled if still in transaction; TRUNCATE deletes all content at once.
- DROP TABLE removes the table and its structure, not just its contents.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.