Infosys Interview Question

Question form SQL and puzzles