Which DELETE statement is valid?

Examine the structure of the EMPLOYEES and NEW_EMPLOYEES tables:

Which DELETE statement is valid?

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�);



Leave a Reply 8

Your email address will not be published. Required fields are marked *


Sadiq Al Sahaf (Sojib)

Sadiq Al Sahaf (Sojib)

Correct Answer: C

Tumelo Keys

Tumelo Keys

Why is A wrong?? i think it is an inline view!

miya

miya

A is wrong as the subquery will reutrn multiple values .It will be correct if = is replaced with IN

From Vietnam

From Vietnam

‘=’ operator cannot be used with multiple-row subquery.
P/S: review the chapter subquery for more info.

kiya

kiya

what about D..why it is incorrect?

ash

ash

It has * -> delete * – wrong syntax