Contest Leaderboard

Sort by

recency

|

2240 Discussions

|

  • + 0 comments

    Using Oracle:

        (SELECT 
            h.hacker_id,
            h.name,
            s.challenge_id, 
            MAX(score) as best_score 
         FROM Hackers h 
         JOIN Submissions s 
            ON h.hacker_id = s.hacker_id 
         GROUP BY h.hacker_id, h.name, s.challenge_id
        ) 
    SELECT hacker_id, name, SUM(best_score) as total_score
    FROM max_scores
    GROUP BY hacker_id, name
    HAVING SUM(best_score) > 0
    ORDER BY total_score DESC, hacker_id ASC;
    
  • + 0 comments

    /* Enter your query here. Please append a semicolon ";" at the end of the query and enter your query in a single line to avoid error. */

    select * from ( select hacker_id, name, sum(max_score) as total_score from ( select s.hacker_id, h.name, s.challenge_id , max(s.score) as max_score from submissions s join hackers h on s.hacker_id = h.hacker_id group by s.hacker_id, h.name, s.challenge_id --HAVING MAX(S.SCORE)>0 ) group by hacker_id, name ) WHERE TOTAL_SCORE <>0 order by total_score desc, hacker_id asc ;

  • + 0 comments
    select hacker_id,name,sum(max_score) as total_score
    from (
        select s.hacker_id,h.name,challenge_id,max(score) as max_score
    from submissions s
    left join hackers h
        on s.hacker_id=h.hacker_id
    group by s.hacker_id,h.name,challenge_id
    having max(score)>0) as max_count
    group by hacker_id,name
    order by total_score desc,hacker_id asc
    
  • + 0 comments

    sql server

    WITH cte1 AS ( SELECT s.hacker_id, h.name, challenge_id, MAX(score) AS max_score FROM submissions s INNER JOIN hackers h ON s.hacker_id = h.hacker_id GROUP BY s.hacker_id, h.name, s.challenge_id HAVING MAX(score) > 0

    )

    SELECT hacker_id, name, SUM(max_score) AS total_score FROM cte1 GROUP BY hacker_id, name ORDER BY SUM(max_score) DESC, hacker_id ASC;

  • + 0 comments

    select newtable.a,newtable.d,sum(newtable.maxscore) from( select hackers.hacker_id as a ,submissions.challenge_ID as b,max(submissions.score) as maxscore,hackers.name as d from hackers join submissions on hackers.hacker_ID=submissions.hacker_id group by hackers.hacker_id,submissions.challenge_id,hackers.name) as newtable group by newtable.a,newtable.d having sum(newtable.maxscore)>0 order by sum(newtable.maxscore) desc ,newtable.a asc