What is the output of the following SQL command if the subquery returns no rows?
What is the output of the following SQL command if the subquery returns no rows?
DELETE FROM Product WHERE ProductID IN (SELECT ProductID FROM ArchivedProduct
WHERE Status = 'Sell');
Show answerHide answer
Correct answer: (A) No rows are deleted
Explanation
If the subquery returns no rows, the IN list is empty and the condition is false for every row, so no rows are deleted from Product and no error occurs.