[DATABASE] HackerRank SQL in 3 days

Hang Nguyen
3 min readMay 12, 2022

--

Hi folks! My pleasure for your visit to this post!

Long story short, the story is that I have finished the SQL track in HackerRank within 3 days. And here are some guidance and personal tips for you, who are about to finish this track or those who are thinking of completing one or even those, who have no idea what it is about :)

This is not a commercial advertisement of HackerRank by all means !!

Learn SQL basics

This sounds ridiculous, doesn’t it?

If you have no idea what SQL is, I will not recommend you doing exercises immediately on HackerRank. Simply because you will not survive for intermediate and advanced level. You can however, keep Googling for easy level one to understand basic concepts. However, you will doom for the next 2 levels.

Sources recommended for learning SQL: w3school. It is easy to understand with some examples for writing SQL scripts. About 1–2 hour on the website, you can grasp the very basics of SQL. No kidding here!

After having all the basics, you will be more prepared for the upcoming 2 levels: medium and hard.

Keep looking for better solution by others

Why we need to do it when we are about to write scripts on our own? Simply because others can have smarter and cleaner scripts than you even believe!

I in fact learnt a lot from others’ scripts. The nature of SQL is that there are only few syntaxes available for you to write scripts. Meaning when it comes to advanced or tricky questions, all you can think in a small span of time is just join all together. THIS IS NOT ALWAYS THE CASE. In fact you can just write normal SELECT FROM without excessive joining.

Where to check for them then? In Discussion section, there are several submissions from others. Not all of them work, but certainly I managed to finish the track so let’s believe that some do work smoothly. Also, if you think one is good, please leave them a comment or an upvote, just for encouragement and small thank to the writer :)

Do not try to print the results for the sake of passing

Nobody says that it’s cheating.

I just want to suggest that please do not do this for the sake of learning for yourself. If you think I am being foolish, please leave this one out. It is completely okay!

The Hard level is indeed very hard

I am being honest here. This is completely hard for me to solve in an hour. Then I suggest you spend at least some hours to understand the scripts from others and recreate another version on your own. That’s my way to pass this level.

Be conscious of noting the parts that you have not yet understood wholy

We are learning here, but learning with consciousness. Meaning that blogging, vlogging should be taken into account. Not simply by memorizing these can make you expert at some thing. Write down with pen and paper, map them out and you can memorize much better!

Have trust in yourself

Doing anything requires a bit tint of trust. Without trust, we can not certainly complete the track in a short span of time. Have some faith and a bit of discipline, you can make it happen!

After all, I wish all the best on the learning journey and hope that you can complete this track fast and furious!

--

--

Hang Nguyen
Hang Nguyen

Written by Hang Nguyen

Just sharing (data) knowledge

No responses yet