QUESTION NO: 49
Examine the structure of the EMPLOYEES and NEW_EMPLOYEES tables:
Which DELETE statement is valid?
A. DELETE FROM employees WHERE employee_id = (SELECT employee_id FROM employees);
B. DELETE * FROM employeesWHERE employee_id=(SELECT employee_id FROM new_employees);
C. DELETE FROM employees WHERE employee_id IN (SELECT employee_id FROM new_employees WHERE name = ‘Carrey’);
D. DELETE * FROM employeesWHERE employee_id IN (SELECT employee_idFROM new_employeesWHERE name = ‘Carrey’);
Answer: C
答案解析:
delete删除表中记录是使用delete form表名,而不是delete * form 表名
另外子查询中必须为返回单条的记录,所以C正确。
Explanation: