Barclays interview question

There was a situational questions based on sql.