Infosys interview question

SQL, coding