Contents

Top Competitors

   Feb 12, 2023     0 min read

Top Competitors

문제

Top_Competitors1.jpg
Top_Competitors2.jpg
Top_Competitors3.jpg
Top_Competitors4.jpg
Top_Competitors5.jpg

코드

Oracle

SELECT H.HACKER_ID
     , H.NAME
FROM SUBMISSIONS S
        INNER JOIN HACKERS H ON S.HACKER_ID = H.HACKER_ID
        INNER JOIN CHALLENGES C ON S.CHALLENGE_ID = C.CHALLENGE_ID
        INNER JOIN DIFFICULTY D ON C.DIFFICULTY_LEVEL = D.DIFFICULTY_LEVEL
WHERE S.SCORE = D.SCORE
GROUP BY H.HACKER_ID, H.NAME
HAVING COUNT(DISTINCT S.SUBMISSION_ID) > 1
ORDER BY COUNT(DISTINCT S.SUBMISSION_ID) DESC, H.HACKER_ID