Q4 Med

mail@pastecode.io avatar
unknown
mysql
2 years ago
329 B
1
Indexable
Never
SELECT h.hacker_id, h.name FROM Submissions AS s join Hackers AS h 
ON s.hacker_id = h.hacker_id 
JOIN Challenges AS c ON s.challenge_id = c.challenge_id
JOIN Difficulty AS d ON c.Difficulty_level = d.Difficulty_level
WHERE s.score = d.score 
GROUP BY h.hacker_id, h.name 
HAVING count(*) > 1
ORDER BY count(*) DESC, h.hacker_id;