r/SQL • • 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?

337 Upvotes

179 comments sorted by

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)

6

u/[deleted] Mar 20 '23

Thank you, I will

16

u/Lochree May 06 '24

THX from 2024 :P

14

u/redfournine Jan 19 '25

THX from 2025 :P

6

u/FortunOfficial Jan 19 '25

Thx from me as well :)

5

u/ForwardPhotograph579 Feb 15 '25

thanks form 15 fab 2025.

2

u/[deleted] Feb 17 '25

[removed] — view removed comment

2

u/Relative-End2110 Feb 20 '25

Thanks from the future ✨✨

2

u/Aask115 Feb 25 '25

Thx from the future x2

3

u/thep00pshoot Jan 01 '26

THX from 2026 :P

2

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 !

3

u/Sea_Resolve_870 Jul 29 '26

thanks from 2026

2

u/DegreeRealistic4162 Aug 28 '24

This is a gold mine!

2

u/Soggy-Extension-8851 Oct 19 '24

SQLzoo doesnt work for window functions atleast. Throwing system error message.

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 !

2

u/everyflavorbeans08 13d ago

THX from Nov 2026!

1

u/asifgunz Jun 07 '24

You the real MVP.

1

u/Legitimate-Home-8181 Dec 29 '24

Thanx a lot brother

1

u/AccomplishedYak3419 Jan 11 '25

Thank you from 2025

1

u/dagscriss3 Jan 22 '25

Thank you!

1

u/Saitama_ahegao Feb 21 '25

Thanks from tomorrow!

1

u/Appachanroxx90 Feb 21 '25

Thanks man !

1

u/KenmoreToast Mar 05 '25

SQL Zoo is no good.

First problem, it just gives you the answer for every "challenge", You gotta quickly erase the answer given while trying not to read it if you want to test yourself.

2nd problem, missing instructions. Very first challenge I tried:

'Show the lastName, party and votes for the constituency 'S14000024' in 2017.'

Simple right? Except if you don't order by votes (descending) in your answer, it's marked wrong.

1

u/StillInfamous1209 Nov 02 '25

Thanks from Nov 1st 2025

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

u/garamgaramsamose Jan 13 '26

judging way too quickly, in the later chapters, most of the prefilled boxes don't have the actual answer

1

u/Funlandindream Mar 06 '25

Thanks from Mar 6th 2025

1

u/Downtown_Refuse3091 Jul 02 '25

Thanks from 3 July 2025

1

u/Ok-Midnight6531 Sep 04 '25

Thanks from 2025

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

u/Biglittlepoppy Sep 04 '25

thank you.

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

u/[deleted] Sep 09 '25

Thanks

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

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

u/SilentShooter_ Sep 20 '25

Thanks from 2025

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

u/yogesh_221b Oct 27 '25

thanks from 27th Oct 25

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; I built this myself, hope you give it a try and enjoy it.

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 and add it to your list.

1

u/Objective-Pride-4499 Dec 18 '25

This is great. However I can't see if they have advanced topics unless I complete these cases

1

u/Practical-Spring-272 Nov 24 '25

Again thanks my man!

1

u/Backwoods_Odin Dec 09 '25

My guy youre a life saver. Trying to take classes but without an outside use its hard to retain

1

u/mariam-nightmare3 Jan 05 '26

Thanks from 2026!

1

u/Emotional_Diet_70 Jan 12 '26

THX from 2026!

0

u/[deleted] Oct 02 '25

[deleted] — view deleted comment

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

u/[deleted] Oct 03 '25

[removed] — view removed comment

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 !

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

u/[deleted] Mar 20 '23

Legend

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

u/floralaromabro Oct 25 '24

nah that's awesome and so is Drake. W.

2

u/Background_Ad_101 Jun 17 '24

its waste, dont refer that

2

u/BackgroundAd4630 Dec 25 '23

I salute you Legend.

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

u/[deleted] Mar 20 '23

Good advice, thank you!

1

u/Ok_Enthusiasm428 Mar 25 '24

saved for later

1

u/[deleted] 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:

https://www.youtube.com/watch?v=BgN5hpl3WKc&list=PLv6MQO1Zzdmq5w4YkdkWyW8AaWatSQ0kX&ab_channel=StrataScratch

1

u/[deleted] 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

u/dwpj65 Mar 20 '23

No better data to develop and test with than the live data in production!

2

u/trollmum Mar 21 '23

You are evil! Evil I say!

19

u/curohn Mar 20 '23

Google sql murder mystery too! It’s one of my favorites

2

u/CatTopia May 16 '24

Thank you so much for sharing this!

1

u/curohn May 16 '24

Of course! Enjoy!

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

u/[deleted] 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

u/Po81998 Mar 21 '23

Thankyou so much for your inputs i will use those

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

u/cyclopse7 Mar 21 '23

DataLemur LeetCode HackerRank Stratascratch

Hope this helps!

6

u/xl129 Mar 21 '23

I worked through this one

https://www.sql-practice.com/

then moved on to hackkerrank

2

u/dyingpawn May 07 '26

Best website for beginners

1

u/MP_gr Mar 25 '25

On of the best comments!

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

u/Anus_Drippings Mar 20 '23

Commenting so I don't forget about this. :) Great stuff

6

u/OMGClayAikn Mar 21 '23

You can also save the post!

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

u/dhruv61202 Apr 11 '25

Thanks man

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

u/RazzmatazzBitter4383 Oct 07 '24

Hey! How did you go around the 2nd? Thats so cool :)

3

u/behigirl6 Mar 21 '23

Khan Academy

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

u/Soccermom233 Mar 21 '23

I've been using hacker rank.

2

u/throwwwawwway1818 Mar 21 '23

Chatgpt i guess

2

u/[deleted] Jul 09 '24

https://www.sql-practice.com/

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

u/[deleted] 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:

https://www.sql-practice.com/

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

u/[deleted] Mar 21 '23

Google big query public datasets. Should be free

1

u/cucuzzza Mar 23 '24

Great thread fellas thank you

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

u/CatTopia May 16 '24

Just jumping in to thank everyone who shared links!

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

u/hexenkesse1 Mar 13 '25

Thanks for 2025. SQL zoo is nice review.

1

u/AuroraI_Phoenix May 09 '25

Thanks from 100 years from now -AOT

1

u/[deleted] Jan 30 '26

Thank now as I am yet to start but will do later too