Amazon interview question

How SQL merge works in SQL