Hackerrank SQL Solutions | Top Competitors SQL Hackerrank Medium Problem
ฝัง
- เผยแพร่เมื่อ 1 มิ.ย. 2020
- In this video I am solving "Top Competitors" Problem on Hackerrank. This is a Medium SQL Problem.
____________________________________________
SUBSCRIBE!
Do you want to understand how to solve SQL Problems in every detail? That's what my channel is about. When I was younger I thought I could never program because it looked way too difficult. The truth is that it takes time but with some patience anybody can do it! Follow me along and get better!
____________________________________________
SUPPORT MY CHANNEL
🙌The best way to support my channel right now is to give me a Super Thanks. You can do that by clicking thanks next to the title of the video. It is much appreciated!
____________________________________________
💾GitHub: github.com/CuriosityLeonardo?...
✋Add me on LinkedIn to get in contact: / markus-friemann-221b3814b
Good work mate! loved the way you approached the problem, and how you broke it down into bits and worked your way towards the answer required.
Thanks! Im glad you liked it
great work mate.
Great job, your thought process is amazing. It helped me not only in the solution but the approach as well that goes into these types of problems.
Just one thing, Why "greater than 1 condition" is supposed to be in the HAVING clause and not in WHERE clause?
really awesome solution !
Man you had it but still struggled for small stuff 😂 but yeah great way to approach a problem
Thanks! Yes these small details can be tedious!
really liked your approach.. keep going !!
Thanks Swarup. Would you like more Hackerrank SQL content or something else?
great explaination
why can't we join difficult and submission table on the score column
Could you please tell me why we having WHERE s.score = d.score
while joining with challenges table, why didn't we joined them based on both columns challenge_id and hacker_id ?
Hi Lalit, we didn't join the challenges table based on the column hacker_id because the hacker_id in the challenges table only tells you what hacker created that challenge. This information is not helpful in creating the desired output
Can you please tell me why did you use LEFT JOIN instead of JOIN?
Hi Sopan, that's a good point, you don't have to use LEFT JOIN in this problem. JOIN works also fine!
Could you please clarify why we having " WHERE s.score = d.score " in where condition
because if you read explanation carefully you will notice that hackers who have obtained full marks are written
Difficulty table contains full score of Difficulty
and submissons score column contains score obtained by hacker
so we need hackers that obtained full score only
This was medium level??
Yes, some of them are quite tricky, even if its just medium