Infosys interview question

database queries