Top Competitors

  • + 0 comments
    with get_A as
    (
    select
    A.hacker_id, count(A.Challenge_Id) Total_no_of_challenges
    from 
    submissions A 
    join challenges B on A.Challenge_Id=B.Challenge_Id 
    join difficulty C on B.difficulty_level=C.difficulty_level 
    where A.score = C.score
    group by A.hacker_id
    having count(A.Challenge_Id)>1
    )
    select x.hacker_id, y.name
    from get_A x join hackers y on x.hacker_id=y.hacker_id
    order by x.Total_no_of_challenges desc, x.hacker_id;