Untitled

 avatar
user_1850551791
plain_text
2 years ago
457 B
4
Indexable
Never
SELECT 
    CONCAT(H.hacker_id, "  ",H.name)
FROM 
    Submissions S
JOIN 
    Challenges C ON S.challenge_id = C.challenge_id
JOIN 
    Difficulty D ON C.difficulty_level = D.difficulty_level 
JOIN 
    Hackers H ON S.hacker_id = H.hacker_id
WHERE 
    S.score = D.score and C.difficulty_level = D.difficulty_level
GROUP BY 
    H.hacker_id, H.name
HAVING 
    count(S.hacker_id) > 1
ORDER BY 
    count(S.hacker_id) DESC, S.hacker_id ASC;