EY interview question

Oops concept Programming Sql queries