LTM Limited interview question

Questions about SQL joins, Java loops