QuestionQ173

VerifiedManipulating Data

Examine the structures of the EMPLOYEES and NEW_EMPLOYEES tables:

EMPLOYEES

  • EMPLOYEE_ID NUMBER Primary Key
  • FIRST_NAME VARCHAR2(25)
  • LAST_NAME VARCHAR2(25)
  • HIRE_DATE DATE

NEW_EMPLOYEES

  • EMPLOYEE_ID NUMBER Primary Key
  • NAME VARCHAR2(60)

Which MERGE statement is valid?

Explanation

Oracle MERGE uses MERGE INTO to name the target table, USING for the source, ON for the match condition, WHEN MATCHED THEN UPDATE for existing rows, and WHEN NOT MATCHED THEN INSERT for new rows. A valid insert may omit the target column list when supplied values correspond to all target-table columns in order.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!