Lagnam InfoTech Interview Question

one query on self join