Barclays Interview Question

There was a situational questions based on sql.