Examine the structure of the EMPLOYEES and NEW_EMPLOYEES tables:
Which MERGE statement is valid?
A.
MERGE INTO new_employees c
USING employees e
ON (c.employee_id = e.employee_id)
WHEN MATCHED THENUPDATE SET C.name = e.first_name ||’, ‘|| e.last_name
WHEN NOT MATCHED THEN
INSERT
value
S(e.employee_id, e.first_name ||’,
‘||e.last_name);
B.
MERGE new_employees c
USING employees e
ON (c.employee_id = e.employee_id)
WHEN EXISTS THEN
UPDATE SET C.name = e.first_name ||’, ‘|| e.last_name
WHEN NOT MATCHED THEN INSERT
valueS(e.employee_id, e.first_name ||’,
‘||e.last_name);
C.
MERGE INTO new_employees cUSING employees e
ON (c.employee_id = e.employee_id)
WHEN EXISTS THEN
UPDATE SET C.name = e.first_name ||’, ‘|| e.last_name
WHEN NOT MATCHED THEN
INSERT
value
S(e.employee_id, e.first_name ||’,
‘||e.last_name);
D.
MERGE new_employees c
FROM employees e ON (c.employee_id = e.employee_id)
WHEN MATCHED THEN
UPDATE SET c.name = e.first_name ||’, ‘|| e.last_name
WHEN NOT MATCHED THEN
INSERT INTO
new_employees valueS(e.employee_id, e.first_name ||’,
‘||e.last_name);
Explanation:
this is the correct MERGE statement syntax
Incorrect answer:
B:
it should MERGE INTO table_name
C:
it should be WHEN MATCHED THEN
D:
it should MERGE INTO table_name
Refer: Introduction to Oracle9i: SQL, Oracle University Study Guide, 8-29