This is a dedicated watch page for a single video.
The view updates represents an incremental batch of all newly ingested data to be inserted or updated in the customers table. The following logic is used to process these records: MERGE INTO customers USING ( SELECT updates . customer_id AS merge_key , updates .* FROM updates UNION ALL SELECT NULL AS merge_key , updates .* FROM updates JOIN customers ON updates . customer_id = customers . customer_id WHERE customers . current = true AND updates . address <> customers . address ) staged_updates ON customers . customer_id = merge_key WHEN MATCHED AND customers . current = true AND customers . address <> staged_updates . address THEN UPDATE SET current = false , end_date = staged_updates . effective_date WHEN NOT MATCHED THEN INSERT ( customer_id , address , current , effective_date , end_date ) VALUES ( staged_updates . customer_id , staged_updates . address , true , staged_updates . effective_date , null ); Which statement describes this implementation?