Dehaat Interview Question

Problem understanding and solving. - Puzzle - SQL - Quick thinking