Top Competitors

  • + 0 comments

    FOR MY SQL: SELECT solver_id, solver_name FROM ( SELECT COUNT(chall_id) AS chall_num , solver_id, solver_name FROM
    (SELECT h.hacker_id AS solver_id, h.name AS solver_name, s.challenge_id AS chall_id, s.score AS solver_score, d.score AS max_score FROM Hackers AS h JOIN submissions AS s ON h.hacker_id = s.hacker_id JOIN challenges AS ch ON ch.challenge_id = s.challenge_id JOIN difficulty AS d ON d.difficulty_level = ch.difficulty_level) AS tot_1 WHERE solver_score = max_score GROUP BY solver_id, solver_name ) AS tab_2 WHERE chall_num >1 ORDER BY chall_num DESC, solver_id ASC;