SQL TutorialLesson 13Free preview
SQL Delete
This lesson is part of SQL · All levels
Summary
DELETE FROM is used to delete a row of data from a table. Just like UPDATE, the WHERE clause is essential so that only the desired row is deleted; without WHERE the entire table contents are deleted. To delete the entire structure of the table and its data, use DROP TABLE, not DELETE.
Key points
- Structure: DELETE from the WHERE condition table;
- Without WHERE it would delete all the rows in the table.
- DELETE deletes the data row, not the column or table.
- TRUNCATE TABLE deletes all lines quickly without being able to filter.
- Because of its destructive nature, DELETE should be tested with SELECT and backed up.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.