Amazon Interview Question

How SQL merge works in SQL