Help me in solving GSQ67 problem

My issue

Learning course: SQL Intermediate
Problem Link: CodeChef: Practical coding for everyone