Barclays interview question

SQL question, how to merge two table