[HackerRank] Top Competitors

데이터 분석/[Python]백준.프로그래머스

[HackerRank] Top Competitors

INCHELIN 2021. 11. 9. 13:32
728x90

https://www.hackerrank.com/challenges/full-score/problem

 

Top Competitors | HackerRank

Query a list of top-scoring hackers.

www.hackerrank.com

select h.hacker_id, h.name
from submissions s
	left join hackers h on s.hacker_id = h.hacker_id
    left join challenges c on c.challenge_id = s.challenge_id
    left join difficulty d on d.difficulty_level = c.difficulty_level
where s.score = d.score
and d.difficulty_level = c.difficulty_level
group by h.hacker_id, h.name
having count(h.hacker_id) >= 2
order by count(h.hacker_id) desc, h.hacker_id asc;
728x90