Tech Mahindra Interview Question

A very SQL Query was asked.