SpinTheMic
Pro

Explain it in 60 seconds

MERGE statement for upserts

Data Engineering · SQL · Intermediate

How does the MERGE statement work, and what should you watch out for?

What a strong answer covers

Your AI report card counts how many of these ideas you cover.

  • MERGE compares a source with a target on a key.
  • WHEN MATCHED can update or delete, WHEN NOT MATCHED inserts.
  • One statement handles inserts and updates atomically.
  • Duplicate keys in the source cause errors or nondeterministic results.
  • Filter the target to limit scanning on big tables.
Practise this topic

Start without signing up. Sign in free to get an AI report card on your answer.

See all topics