Hackerrank SQL Solutions | Interviews SQL Hackerrank Hard Problem

preview_player
Показать описание
You find this problem at:
____________________________________________

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!

____________________________________________

Рекомендации по теме
Комментарии
Автор

It's amazing how you hacked your way to the correct answer, the excel debugging trick was especially cool.
Formatting, version control using notepad, copy pasting the CTE were all nice ideas.

I have 1 comment and 1 suggestion:

24:22-25:15 "In 1 SELECT statement, you can only go from contests table".
You can go from any table to any other table any number of times. If join A to B, the next table can be joined to A or B, not necessarily A. The 23:50 error was saying table names are duplicated. But even if you deduplicated them by changing to col2, it's still wrong because you joined Contests<-Colleges<-Colleges, when you meant The ON conditions are correct but the last FROM specified the wrong table.

Possible improvements if this was meant to be a more general SQL tutorial rather than tackling this question only.

Han-veuh
Автор

just love how some people really love to do their work and are passionate about it and are not here on youtube just for views. you are one of them. thank you.

ritikabali
Автор

To be honest i actually felt why this video is 1 hour and i initially not interested and thinking like skip this one problem in hacker rank but the way cross checked with excell and making the queries in chunks and chunks very brilliant respect brother❤

balaroxx
Автор

You should share the code in the Github link... So it will be easy to copy the code. Thank you for detailed explanation.

learnds
Автор

Hats off to you sir.. Amazing solution..

dramaticreviews
Автор

Best explanation - I was joining all the 5 tables together and getting the same answer as you were earlier. Now I get the reason of why that is the wrong answer, thanks to your video you made for Sidra :D

But I still have a confusion, so are the sums getting multiplied because of a cardinality clause or is it because we cannot join all of these 5 tables together?

hashjkbaaaa
Автор

hi, thanks for sharing this. 1) Why did we use INNER JOIN? 2) Why did we need temporary table, when would we know from the problem, we would need temporary tables? Thankyou!

aditiarya
Автор

Thank you for sharing your work, and thought process. The code was clean and understandable too. For the edge case, isn't it better to you AND instead of OR since it only asked to exclude if all 4 sums are 0? I think the current code might not meet the requirements if only one sum is 0 since it exclude the whole contest.

davidmuhimuzi
Автор

Why did we use the Submission_Stats table before View_Stats table

hollyquran
Автор

This is really impressive!! Detailed and informative

geofreykweyu
Автор

Hello sir, why are we not joining all five tables together, is it possible to do it that way? Btw, thank you for this solution.

ShyamSundar-potn
Автор

Sir, can you tell me what changes in have to make for mysql ?

wasimpatel
Автор

Well done dude! Solved it like a master!

adarshrai
Автор

what i learned
1. to working with snow flake schema we need to join with temp tables.
2. WITH clause allows as many tables you want

thanks i go to update my notes

ssaaurabh
Автор

Hi, when I tried the code it gave an error, i think someone below complained about same error, I have also reached out to you through an email. Hoping for a reply

olanikedurojaiye
Автор

Very Nicely Explained!! Thank you so much.

paragrehani
Автор

I have a doubt at 24.01, why we were not able to join Contest with other tables while we were successful in joining 3 tables using With clause? Please explain

rafjy
Автор

Apart from with statement, how else could one achieve the joining

geofreykweyu
Автор

@MM Please explain (if possible) why the previous solution with 6000 total submissions is incorrect ? I mean why it was not a correct solution? what was the reason
P.S: thank you for explaining how you debugged the issue, it was very helpful
Basically first we need to take one test data point
Then check that data point at each stage to see how data is flowing
I didn't know this technique before, thank you

Also can we use multiple joins within a CTE in Mysql

sidrahms
Автор

IS there any way i can get this code of yours plz reply

anuragmishra
welcome to shbcf.ru