Top Competitors

  • + 0 comments

    MS SQL

    SELECT H.hacker_ID, H.name
    FROM Submissions S
    INNER JOIN Challenges C ON C.Challenge_ID = S.Challenge_ID
    INNER JOIN Difficulty D ON D.Difficulty_Level = C.Difficulty_Level
    INNER JOIN Hackers H ON H.hacker_ID = S.hacker_ID
    WHERE S.Score = D.Score
    GROUP BY H.hacker_ID, H.name
    HAVING COUNT(S.Challenge_ID) > 1
    ORDER BY COUNT(S.Challenge_ID) DESC, H.hacker_ID ASC;