Genpact Interview Question

SQL queries in moderate level