[HackerRank] MySQL - Top Competitors Smelt Roe Sushi

데이터 분석/[SQL] 기초

[HackerRank] MySQL - Top Competitors

INCHELIN 2025. 3. 21. 00:04
728x90
select h.hacker_id, h.name
from submissions as s
    join hackers as h on s.hacker_id = h.hacker_id
    join challenges as c on s.challenge_id = c.challenge_id
    join difficulty as d on c.difficulty_level = d.difficulty_level
where d.score = s.score
group by h.hacker_id, h.name
having count(s.hacker_id) > 1
order by count(s.hacker_id) desc, s.hacker_id asc
728x90