r/SQL • u/[deleted] • Mar 20 '23
Discussion Where to practice SQL?
I have read tutorials and learned the basics of the language. Are there resources of practice problems/projects?
48
u/Thefriendlyfaceplant Mar 20 '23
In addition to what's already provided:
https://datalemur.com/
https://sqlbolt.com/
https://www.stratascratch.com/
But there's more theory than just learning the basics of the language. The next step is learning how to break down complex tasks in smaller compartments.
57
u/NickSinghTechCareers Author of Ace the Data Science Interview 📕 Mar 20 '23
Founder of DataLemur here - appreciate the mention!
8
5
u/infjetson Mar 21 '23
Love how active you are on Reddit, I see you all over the place! A true MVP.
9
u/NickSinghTechCareers Author of Ace the Data Science Interview 📕 Mar 21 '23
Thanks! I try to help/shill wherever I can lol
4
u/LeftShark Mar 21 '23
DataLemur is really cool as a site, but after signing up, I'm getting weird emails from DataLemur about how Drake's fans are getting interviews in Data Science because they're Drake's #1 fan. If this is the norm, there's no way I continue allowing your site into my emails.
9
u/NickSinghTechCareers Author of Ace the Data Science Interview 📕 Mar 21 '23
Hi! That email is from me (the founder) and it explains the origin story behind DataLemur, and how fanboying Drake led me to Facebook which led me to found DataLemur!
It’s a more colorful take on a welcome email/thank you for signing up email, and everyone gets it the day they sign up.
The next email in the sequence is about 6 cool SQL resources which I hope you find valuable.
Sorry if it feels strange - feel free to unsubscribe from the emails using the link at the bottom of the email!
2
2
2
1
u/Background_Ad_101 Jun 17 '24
its waste,, stop your advertisement, i have checked some of the interview questions from data Lemur and nothing came from that stupid website, stop making fools. infact it was completly misleading
1
1
1
Mar 21 '23
I'm guessing learning how to break down complex tasks is something that just comes with time and experience?
I'm doing a short course and was just introduced to nested queries, and the solution to the second test question for nested queries included a double nested query. I could have never guessed an extra query was required.
5
u/Thefriendlyfaceplant Mar 21 '23
It doesn't. The video tutorials of experts walking you through interview questions are more than just them filling in the syntax, they're explaining the thought process behind it and how to repeat the same workflow for different problems:
1
Mar 21 '23
Thanks! I'll have to check that out more.
4
u/Thefriendlyfaceplant Mar 21 '23
Yeah just binge it, watching the most complex applications first is probably the most productive way to spend your time as a beginner, even if you're not fully familiar with syntax. It gives you a way to orient further learning.
30
u/ShadoGear Mar 20 '23
Production database at you're workplace if you need a bit of danger in your life.
11
2
19
u/curohn Mar 20 '23
Google sql murder mystery too! It’s one of my favorites
2
2
u/RobRoy187 May 04 '25
Thanks for sharing mate, it is indeed a gem, exactly what I was looking for - I'm glad I scrolled this far down, this should be top of the page
1
u/Little_Locksmith440 May 14 '25
thanks man, the process of learning SQL has become more enjoyable, it's a very interesting game.
11
u/Xidium426 Mar 20 '23
You can download things like MLB datasets as a CSV file, import them into a local SQLite database and practice there.
2
Mar 20 '23
Yes, the only way to really learn sql is trying to make things work with large datasets on an underperforming database install on the computer.
It’s important the computer you are on really struggles with the large dataset. So, if on powerful enough computer make virtual machine to nerf the cpu and ram ( altering settings in db install to nerf it is educational too but probably not if just learning!)
Then, make sql run , if sql runs ok remove some indexes from tables to handicap that.
Anyone can learn how to make simple sql queries. The skill is learning to do such things as above. Except I would just install one of the standard sql engines instead of sql lite.
Have fun making things work!!
3
u/xl129 Mar 21 '23
I get your point but it's for more advance level of skill. Early phase you want quick run time so you can experiment with adding, removing, modifying your queries to try out different scenarios.
1
u/Po81998 Mar 20 '23
Is there any online source to import large excel and work on that database without downloading any application on pc and i want to add it to my portfolio
2
u/Higgs_Br0son Mar 20 '23
Maybe cloud databases? Google BigQuery, Microsoft Azure Synapse, Amazon Redshift, Snowflake.
Google BigQuery is probably cheapest option, or completely free in your case. 1TB of queries and 10GB of storage each month is free. More than that and you pay per usage.
Azure Synapse is free for 1TB of queries, but you'll pay their storage rates for the data set, it's like $0.02 per GB.
Amazon Redshift has a 90-day trial period, but you'll pay per use after.
Snowflake has a 30-day trial and it's unclear what the pricing is after.
I'm sure there's some other web apps like Kaggle that might be good options, but since you mentioned your portfolio, cloud databases are probably good to build experience in.
1
1
u/a_devious_compliance Mar 21 '23
Can I ask why you don't want to download an application? Having to tinker with instalation, config and set up is also a valuable skill.
1
u/Po81998 Mar 21 '23
Actually I did install ssms I'm trying to do some project using it when i tried to import data using task i was getting some error , also i wasn't able to find SQL server native client 11 , which was used a destination in all the videos i saw , but i chose a different one and the excel has been imported now hope it will work .
Just wanted to know if there is an online source if in case this doesn't work
1
u/a_devious_compliance Mar 22 '23
Windows. Sorry, I can't help with that. But you could ask help about your error.
6
6
5
u/Billi0n_Air Mar 20 '23
you want datasets to run queries against? https://catalog.data.gov/dataset/?res_format=CSV
some practical stuff to get reps in https://www.w3resource.com/sql-exercises/
4
4
u/Patient-Reindeer6311 Mar 21 '23
A bit obscure, but if you run out of questions to practice, here you go https://www.sql-ex.ru/?Lang=1
1
3
u/Dramatic_Towel6536 Mar 20 '23
Check this site which has easy,medium,hard questions to solve and with tutorial sql practice
3
u/SirGreybush Mar 20 '23
Try to decide where your creative space is.
Designing software that needs a database.
Compilation and aggregation of data for high end reporting.
Data profiling, correcting and transformations.
Or, get an analyst position (business or fonctional).
Last one being spending a LOT of time in meetings, Excel and Word documents with a dash of PowerPoint. (No OneNote cuz the grey hairs don’t get it)
The first three I’ve done over a span of 25 years, and SQL was at least 26 years in there.
The most fun the first three if you are creative and easily accept constructive criticism.
1
3
2
u/mgramin Mar 20 '23
We have a training project where we generate data for Pagila db via pure SQL - https://github.com/synthesized-io/pagila-data-generation You could add some new queries or update some existed ones, just create a PR
2
u/DataMasteryAcademy Mar 21 '23
Check this out: https://www.datamasteryacademy.com/offers/i2FndgNs/checkout it is a sql guided project course that shows you how to work with a real world dataset while teaching sql from basics to advanced everything you need
2
2
2
Jul 09 '24
Is the best. It is free, no signing up required. The questions range from easy to hard complex queries and they have their own practice db.
1
u/MP_gr Mar 12 '25
Do you know if there's a way to download the databases and queries questions to solve offline ?
2
Apr 17 '25
One way to practice it offline is to have MS SQL installed. Then download the Adventureworks sample database here https://learn.microsoft.com/en-us/sql/samples/adventureworks-install-configure?view=sql-server-ver16&tabs=ssms
and have fun!
2
u/lets_talk_about_tv Apr 16 '25
I used this one. Hope this Helps:
1
u/TurbulentCountry5901 Nov 16 '25
A cool detective-themed SQL game where you solve cases using queries. Great way to learn SQL: sqlcasefiles.com , hope you give this a try !
1
1
1
u/MathAngelMom Apr 19 '24
LearnSQL.com has a lot of SQL practice courses and articles: https://learnsql.com/blog/sql-practice-guide/
Each month they release a new SQL practice problem. And each month one of the courses is available for free: https://learnsql.com/tags/course-of-the-month/
1
u/justani98 Apr 25 '24
For real world case studies of SQL to practice I found these very helpful - https://www.codechef.com/practice/sql-case-studies-topic-wise
1
1
u/SoulSoldSeparatly Jun 04 '24
I don't know if anyone still monitors this reddit, but has anyone here used LearnSQL ?
1
u/MP_gr Feb 18 '25
I was looking for sources to practice SQL too. A few months ago I had found from Reddit this source --> https://www.richardtwatson.com/open/Reader/ClassicModels.html# which provides a database you can load, and 82 questions of queries to solve.
On Github I had found a repository with solutions, however less than half solutions were uploaded.
So I decided to solve all 82 queries and upload them on my repository here --> https://github.com/Mikegr1990/ClassicModels-SQL-Solutions
For me that was a great source for practicing, since the queries start from very basic to advanced and covers many aspects of sql.
1
1
1
1
150
u/BitesizedBlubber Mar 20 '23 edited Mar 20 '23
Hope these help!
Practice SQL - SQL Zoo
SQL Challenges - HackerRank
Explore - DoltHub - This has public databases that you can query. I find it pretty fun to find a database that contains data you might find interesting and start practicing that. (I.e. challenge yourself to find top 10 NBA scorers under 25 years of age or whatever)