We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
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;
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Top Competitors
You are viewing a single comment's thread. Return to all 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;