Question d’entretien chez Tech Mahindra

Showed SQL query and asked to solve