Infosys interview question

SQL queries