nerdexam
Oracle

1Z0-007 · Question #179

Examine the data in the EMPLOYEES and EMP_HIST tables: The EMP_HIST table is updated at the end of every year. The employee ID, name, job ID, and salary of each existing employee are modified with…

The correct answer is B. MERGE INTO emp_hist eh. This task can be done using the MERGE command. Correct syntax for the MERGE command is MERGE INTO table1 USING table2 on (join_condition) WHEN MATCHED UPDATE SET col1 = value WHEN NOT MATCHED INSERT (column_list) values (column_values). Incorrect Answers A: MERGE command can…

Manipulating Data (DML)

Question

Examine the data in the EMPLOYEES and EMP_HIST tables:

The EMP_HIST table is updated at the end of every year. The employee ID, name, job ID, and salary of each existing employee are modified with the latest data. New employee details are added to the table. Which statement accomplishes this task?

Exhibit

1Z0-007 question #179 exhibit

Options

  • AUPDATE emp_hist
  • BMERGE INTO emp_hist eh
  • CMERGE INTO emp_hist eh
  • DMERGE INTO emp_hist eh

How the community answered

(34 responses)
  • A
    6% (2)
  • B
    76% (26)
  • C
    3% (1)
  • D
    15% (5)

Explanation

This task can be done using the MERGE command. Correct syntax for the MERGE command is MERGE INTO table1 USING table2 on (join_condition) WHEN MATCHED UPDATE SET col1 = value WHEN NOT MATCHED INSERT (column_list) values (column_values). Incorrect Answers A: MERGE command can handle this task, not UPDATE: new employee details will not be added C: This statement would by correct if UPDATE SET is syntax used, not UPDATE table_name SET syntax as in usual UPDATE command. D: "ON condition" clause of the MERGE command is absent.

Topics

#MERGE statement#WHEN MATCHED#WHEN NOT MATCHED#upsert

Community Discussion

No community discussion yet for this question.

Full 1Z0-007 Practice