QuestionQ146Verified/Manipulating DataCopy linkReport a problemAsk AstroTutorSave questionReview the structures of the EMPLOYEES and NEW_EMPLOYEES tables: Which MERGE statement is valid?AMERGE INTO new_employees c USING employees e ON (c.employee_id = e.employee_id) WHEN MATCHED THEN UPDATE SET name = e.first_name ||', '|| e.last_name WHEN NOT MATCHED THEN INSERT value S(e.employee_id, e.first_name ||', '||e.last_name);BMERGE new_employees c USING employees e ON (c.employee_id = e.employee_id) WHEN EXISTS THEN UPDATE SET name = e.first_name ||', '|| e.last_name WHEN NOT MATCHED THEN INSERT valueS(e.employee_id, e.first_name ||', '||e.last_name);CMERGE 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);DMERGE new_employees c FROM employees e ON (c.employee_id = e.employee_id) WHEN MATCHED THEN UPDATE SET 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);Show AnswerAnswerExplanationOracle MERGE uses a target specified with MERGE INTO, a source specified with USING, a match condition in ON, and WHEN MATCHED and WHEN NOT MATCHED clauses for update and insert actions. When no insert column list is specified, the number of supplied values must match the target table’s columns; the two supplied values match NEW_EMPLOYEES columns EMPLOYEE_ID and NAME in order.Learn moreOracle Database SQL Language Reference: MERGEShow comments0Show commentsCommunity DiscussionNo comments yet. Be the first to start the discussion!
Community Discussion