Infosys Interview Question

Distinct query in SQL was easy