BNP Paribas interview question

oops concept and some basic SQL query.