Infosys interview question

was asked to solve an rdms nested query