Iron Mountain interview question

SQL questions and scripts basically for logical related merge, case statement