Hi Nishtha, Thank you for the solution. One thing i'd like to point out is, 2:16 you said that score are not the same for submission and challenges table. but then you use WHERE Clause. so if they are not same or equal, how it is giving result then? When you said score are different for both the tables, it means no matching values of score?
Thank you, guess I still have much to learn about joins, dont feel comfortable using that many. At first I tried using CTE's, didnt work for some reason so I had to use subquerys. Ashamed of my result but it worked 💀: SELECT Scores.hacker_id, h.name FROM (SELECT s.hacker_id, s.score as sub_score, cp.score as cp_score, CASE WHEN s.score = cp.score THEN 'yes' ELSE 'no' END AS is_max FROM Submissions s, (SELECT g.challenge_id, d.score FROM Challenges g JOIN Difficulty d ON d.difficulty_level = g.difficulty_level) cp WHERE s.challenge_id = cp.challenge_id) Scores JOIN Hackers h ON h.hacker_id = Scores.hacker_id WHERE is_max = 'yes' GROUP BY Scores.hacker_id, h.name HAVING COUNT(h.name)>1 ORDER BY COUNT(h.name) DESC, Scores.hacker_id ASC