Infosys interview question

oops concepts, sql queries