Top Competitors

Sort by

recency

|

2299 Discussions

|

  • + 0 comments

    SELECT S.hacker_id,H.name FROM Submissions as S LEFT JOIN Challenges as C on C.challenge_id=S.challenge_id LEFT JOIN Difficulty as D on C.difficulty_level=D.difficulty_level 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()>1 Order by Count() desc, S.hacker_id asc

  • + 0 comments
    select h.hacker_id, h.name
    from Hackers h, Submissions s, Challenges c, Difficulty d
    where h.hacker_id = s.hacker_id
        and s.challenge_id = c.challenge_id
        and c.difficulty_level = d.difficulty_level
        and s.score = d.score
    group by h.hacker_id, h.name
    having count(h.hacker_id) > 1
    order by count(h.hacker_id) DESC, h.hacker_id ASC
    
  • + 1 comment
    SELECT cte.hacker_id, cte.name
    FROM (
    SELECT h.hacker_id, h.name, COUNT(s.challenge_id) AS total_ch
    FROM Hackers h
    JOIN Submissions s ON h.hacker_id = s.hacker_id
    LEFT JOIN Challenges c ON s.challenge_id = c.challenge_id
    JOIN Difficulty d ON c.difficulty_level = d.difficulty_level AND s.score = d.score
    GROUP BY h.hacker_id, h.name
    ORDER BY total_ch DESC, h.hacker_id ASC) AS cte
    WHERE cte.total_ch > 1
    
  • + 0 comments
    select H.hacker_id, name 
    from Difficulty D
    join Challenges C on D.difficulty_level = C.difficulty_level
    join Submissions S on C.challenge_id = S.challenge_id
    join Hackers H on H.hacker_id = S.hacker_id
    where S.score = D.score
    GROUP BY 1, 2
    HAVING COUNT(S.challenge_id) > 1
    ORDER BY COUNT(S.challenge_id) DESC, 1;
    
  • + 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;