Which MERGE statement is valid?

Examine the structure of the EMPLOYEES and NEW_EMPLOYEES tables:

Which MERGE statement is valid?

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 THEN
UPDATE SET

B.
name = e.first_name ||’,’|| e.last_name
WHEN NOT MATCHED THEN
INSERT
value
S(e.employee_id, e.first_name ||’,
‘||e.last_name);

C.
MERGE new_employees c
USING employees e
ON (c.employee_id = e.employee_id)
WHEN EXISTS THEN
UPDATE SET

D.
name = e.first_name ||’,’|| e.last_name
WHEN NOT MATCHED THEN INSERT
valueS(e.employee_id, e.first_name ||’,
‘||e.last_name);

E.
MERGE INTO new_employees cUSING employees e
ON (c.employee_id = e.employee_id)
WHEN EXISTS THEN
UPDATE SET

F.
name = e.first_name ||’,’|| e.last_name
WHEN NOT MATCHED THEN
INSERT
value
S(e.employee_id, e.first_name ||’,
‘||e.last_name);

G.
MERGE new_employees c
FROM employees e ON (c.employee_id = e.employee_id)
WHEN MATCHED THEN
UPDATE SET

H.
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:
Bit should MERGE INTO table_name
Cit should be WHEN MATCHED THEN
Dit should MERGE INTO table_name
Refer: Introduction to Oracle9i: SQL, Oracle University Study Guide, 8-29



Leave a Reply 5

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


daroldrudolph

daroldrudolph

WHEN MATCHED THEN UPDATE SET

This seems like the statement is not finished. Besides the primary keys the field names do not match.

Gabriel K

Gabriel K

Looks like a typo here, A + B is one answer = A option, C + D is another one = B option, E + F = C option, G + H = D option

Pramudya Yanuanto

Pramudya Yanuanto

Not finished question. Notice that in New_Employees table there are Nam, which is logically combined from 2 column in Employees table

Sadiq Al Sahaf (Sojib)

Sadiq Al Sahaf (Sojib)

Yes..
Correct answer: A

ydisconzi

ydisconzi

Question made in a bad way to understand