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.
way too many joins, if I was asked this in an interview, I am screwed. Takes forever to understand the question.
SELECT
s.hacker_id, h.name
FROM
( Difficulty AS d LEFT JOIN Challenges as c ON d.difficulty_level = c.difficulty_level
LEFT JOIN Submissions AS s ON s.challenge_id = c.challenge_id
LEFT JOIN Hackers AS h ON h.hacker_id = s.hacker_id)
WHERE
s.score = d.score
GROUP BY
s.hacker_id, h.name
HAVING
COUNT(s.challenge_id) > 1
ORDER BY
COUNT(s.challenge_id) DESC, s.hacker_id;
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 →
way too many joins, if I was asked this in an interview, I am screwed. Takes forever to understand the question.