Examine the structure of the EMPLOYEES and NEW_EMPLOYEES tables:
Which DELETE statement is valid?
A.
DELETE FROM employeesWHERE employee_id = (SELECT employee_id FROM employees);
B.
DELETE * FROM employeesWHERE employee_id=(SELECT employee_id FROM
new_employees);
C.
DELETE FROM employeesWHERE employee_id IN (SELECT employee_id FROM
new_employees WHERE name = �Carrey�);
D.
DELETE * FROM employeesWHERE employee_id IN (SELECT employee_id FROM
new_employees WHERE name = �Carrey�);
Correct Answer: C
c only
Why is A wrong?? i think it is an inline view!
A is wrong as the subquery will reutrn multiple values .It will be correct if = is replaced with IN
‘=’ operator cannot be used with multiple-row subquery.
P/S: review the chapter subquery for more info.
what about D..why it is incorrect?
It has * -> delete * – wrong syntax
tnx ash