BNP Paribas Interview Question

oops concept and some basic SQL query.