We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
  • HackerRank Home

    HackerRank

  • |
  • Prepare
  • Certify
  • Compete
  • Apply
  • Hiring developers?
  1. Prepare
  2. SQL
  3. Basic Join
  4. Top Competitors
  5. Discussions

Top Competitors

Problem
Submissions
Leaderboard
Discussions

Sort 1832 Discussions, By:

recency

Please Login in order to post a comment

  • kvsurpuriya15
    1 day ago+ 0 comments

    SELECT Submissions.hacker_id, Hackers.name FROM Submissions INNER JOIN Hackers ON Submissions.hacker_id = Hackers.hacker_id INNER JOIN Challenges ON Submissions.challenge_id = Challenges.challenge_id INNER JOIN Difficulty ON Difficulty.difficulty_level = Challenges.difficulty_level WHERE Submissions.score=Difficulty.score GROUP BY 1,2 HAVING COUNT()>1 ORDER BY COUNT() DESC, Submissions.hacker_id ASC;

    0|
    Permalink
  • faarisilmi
    3 days ago+ 1 comment

    I still did not get it why we join Submissions table and Challenges table on challenge_id not hacker_id?. Please enlighten me

    0|
    Permalink
  • ranjithkumarchi1
    3 days ago+ 0 comments

    select h.hacker_id,h.name from Hackers h inner join Submissions s on h.hacker_id=s.hacker_id inner join Challenges c on s.challenge_id=c.challenge_id inner join Difficulty d on c.difficulty_level=d.difficulty_level where d.score=s.score group by h.hacker_id,h.name having count(c.challenge_id)>1 order by count(c.challenge_id) desc, h.hacker_id

    0|
    Permalink
  • htharshht5
    3 days ago+ 0 comments

    This is my submission :

    SELECT S.hacker_id, H.name
    FROM Submissions AS S
    JOIN Challenges AS C
    ON S.challenge_id = C.challenge_id
    JOIN Difficulty AS D
    ON C.difficulty_level = D.difficulty_level
    JOIN Hackers AS H
    ON H.hacker_id = S.hacker_id
    WHERE D.score = S.score
    GROUP BY 1, 2
    HAVING COUNT(S.hacker_id) > 1
    ORDER BY COUNT(S.challenge_id) DESC, S.hacker_id
    
    0|
    Permalink
  • anupa_setty
    5 days ago+ 0 comments

    MYSQL select s.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 1,2 having count(C.challenge_id)>1 order by count(C.challenge_id) desc, 1

    0|
    Permalink
Load more conversations

Need Help?


View top submissions
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy