
Ultimate access to all questions.
A junior data engineer has implemented the following SQL code to update a Delta table named events using data from a source view called new_events:
MERGE INTO events
USING new_events
ON events.event_id = new_events.event_id
WHEN NOT MATCHED THEN
INSERT *
MERGE INTO events
USING new_events
ON events.event_id = new_events.event_id
WHEN NOT MATCHED THEN
INSERT *
Both the table and the view share the same schema and utilize event_id as a unique primary key. Given this code, what will happen to records in new_events that have an event_id already existing in the events table?*
A
The existing records with matching event_id will be deleted and replaced with the new source data._
B
The existing records with matching event_id will be updated using the attributes from new_events.
C
The new records will be disregarded (ignored).
D
The new records will be merged with the existing ones into a nested structure.
E
The new records will be inserted as separate entries, resulting in duplicate event_id values in the target table._