Capgemini interview question

Oops concepts SQL queries