Exam-style question
Try this first
Write an SQL statement to delete the row from Customer whose CustomerID is 45. Explain why the condition is important.
Model answer
What a good answer should say
- DELETE FROM Customer WHERE CustomerID = 45;
Explanation
Why this works
DELETE FROM identifies the table from which a row is to be removed. The WHERE condition restricts the deletion to the row whose CustomerID is 45.
Without a condition, the statement could delete every row in the table.
Common mistake
No common mistake is linked to this question yet.
