Home » Oracle » 1z0-051 » 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_idFROM employees);
B. DELETE * FROM employeesWHERE employee_id = (SELECT employee_idFROM new_employees);
C. DELETE FROM employeesWHERE employee_id IN(SELECT employee_idFROM new_employeesWHERE name = ‘Carrey’);
D. DELETE * FROM employeesWHERE employee_id IN (SELECT employee_idFROM new_employeesWHERE last_name = ‘Carrey’);
Correct Answer: C
Explanation/Reference:
Explanation:
Explanation:
The correct syntax for DELETE statement
DELETE [ FROM ] table
[ WHERE condition ];
Incorrect Answers :
A. ‘=’ is use in the statement and sub query will return more than one row.
Error Ora-01427: single-row sub query returns more than one row.
B. Incorrect DELETE statement
D. Incorrect DELETE statement
Refer: Introduction to Oracle9i: SQL, Oracle University Student Guide, Manipulating Data, p. 8-19
Download Printable PDF. VALID exam to help you PASS.
|
|