Database Fundamentals — Question 119
A database contains two tables named Customer and Order.
You execute the following statement:
DELETE FROM Order -
WHERE CustomerID = 209 -
What is the result?
Answer options
- A. The first order for CustomerID 209 is deleted from the Order table.
- B. All orders for CustomerID 209 are deleted from the Order table, and CustomerID 209 is deleted from the Customer table.
- C. All orders for CustomerID 209 are deleted from the Order table.
- D. CustomerID 209 is deleted from the Customer table.
Correct answer: C
Explanation
The correct answer is C because the DELETE statement with the specified condition will remove all entries in the Order table that match CustomerID 209. Options A, B, and D incorrectly suggest that only one order or the customer itself is deleted, which is not the case with this SQL command.