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
  • Hiring developers?
  1. Prepare
  2. SQL
  3. Basic Join
  4. Top Competitors
  5. Discussions

Top Competitors

Problem
Submissions
Leaderboard
Discussions

Sort 1688 Discussions, By:

recency

Please Login in order to post a comment

  • agrawalanish420
    3 hours ago+ 0 comments

    select submissions.hacker_id,hackers.name from hackers inner join submissions on hackers.hacker_id=submissions.hacker_id inner join challenges on challenges.challenge_id=submissions.challenge_id inner join difficulty on challenges.difficulty_level=difficulty.difficulty_level where difficulty.score=submissions.score group by submissions.hacker_id,hackers.name having count(hackers.name)>1 order by count(hackers.name) desc,submissions.hacker_id asc

    0|
    Permalink
  • harishrajmudira1
    20 hours ago+ 1 comment

    Plz someone help me ,what's wrong in this query. select a.hacker_id, a.name from hackers a join submissions b on a.hacker_id= b.hacker_id where b.challenge_id in (select a.challenge_id from challenges a join difficulty b on a.difficulty_level=b.difficulty_level) and b.score in (select a.score from difficulty a join challenges b on a.difficulty_level=b.difficulty_level) group by a.hacker_id having count(a.hacker_id)>1 order by count(a.hacker_id) desc, a.hacker_id asc

    0|
    Permalink
  • Nagre_Saurabh
    24 hours ago+ 0 comments

    MYSQL:

    select s.hacker_id, h.name from submissions as s 
    			inner join Challenges as c on s.challenge_id=c.challenge_id
    			inner join Difficulty as d on d.difficulty_level=c.difficulty_level
    			inner join Hackers as h on h.hacker_id=s.hacker_id 
    where d.score=s.score 
    group by s.hacker_id,h.name having count(*)>1 
    order by count(*) desc, s.hacker_id;
    
    0|
    Permalink
  • qayum_khan_usa
    3 days ago+ 0 comments

    MySQL:

    SELECT hacker_id, name FROM (
        SELECT H.hacker_id, name, COUNT(challenge_id) AS ct
        FROM Submissions AS S
        LEFT JOIN Hackers AS H USING (hacker_id)
        LEFT JOIN Challenges USING (challenge_id)
        LEFT JOIN Difficulty AS D USING (difficulty_level)
        WHERE S.score = D.score
        GROUP BY H.hacker_id, name HAVING ct > 1
        ORDER BY ct DESC, H.hacker_id ASC
    ) AS rankings;
    
    0|
    Permalink
  • yadavaniliit
    3 days ago+ 0 comments

    select h.Hacker_ID, Name from submissions s join challenges c on s.challenge_id=c.challenge_id join difficulty d on d.difficulty_level=c.difficulty_level join Hackers h on s.hacker_id=h.hacker_id

    where s.score=d.score group by h.Hacker_ID, Name having count(submission_id)>1 order by count(submission_id) desc,h.Hacker_ID

    0|
    Permalink
Load more conversations

Need Help?


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