Barclays Interview Question

basic sql questions and puzzles