Write a SQL MERGE statement that upserts from staging.users into production.users. Match on user_id. If matched and email or name changed: update those fields and set updated_at = NOW(). If not matched: insert the full row.
Sign in to see what a strong answer covers and to get AI feedback on your own.