Barclays Interview Question

Few SQL questions like write a query to achieve a particular scenario.