Infosys interview question

a question based on sql query