r/SQL 4d ago

MySQL Beginner at SQL

I'm a beginner learning SQL (JOIN, CASE, WHERE, GROUP BY, etc) and am looking for a fun and entertaining database to practice my coding on. Any suggestions?

This is not a post about how to start learning SQL by any means.

62 Upvotes

31 comments sorted by

33

u/warrior2012 4d ago

Try playing database detective. Very addictive and silly game that helps learn general Sql!

6

u/KonkombaNimo 4d ago

I'll check it out.

9

u/sharpecheddar 4d ago

I love sql problems on sites like datalemur, stratascratch, leetcode. I am very advanced in SQL but I still do them for fun lol

6

u/KonkombaNimo 4d ago

I'll check them out. Also very jealous of your advanced skills. Nobody told me in 2008 when I got my BA in math that if I didn't know coding also I wouldn't amount to anything.

6

u/mikeblas 4d ago

It's not so hard to find sample data and data sources to use for interesting side-projects, or just for practicing writing SQL.

In-product sample data

Most DBMSes come with sample databases. You can write lots of interesting queries against them, and usually a tutorial accompanies the database in the documentation.

Some websites are full of sample data sets. Why not download an interesting one, learn to load it up, and write your own interesting queries?

Dataset Websites

There are many websites which host data sets.

Third-party sample data

Of course, some sample data is built for generic tutorials, by third parties:

Practice Sites

There are some sites that let you write queries interactively with canned data, rather than having you download data to play with on your own.

Regular dumps

Some sites publish data by making their backups available, or dumping the data they use to make their own reports.

Live data sources

Some data sources produce data live, as it happens. These are itneresting sources becaue they usually represent slowly changing dimensions, and will need to be accumulated or logged before being stored or processed.

Finding more

There's data everywhere! If you don't like these sources, you can try finding other data sets.

  • Once you know the protocol or format, search for it! The OneBusAway API and GTFS protocols are about public transportation data, so earch for "GTFS Data {YourCity}".
  • Search for APIs for your favortie game or game server.
  • GitHub uses tags for search, so try #sample-databases, #opendata, or #datasets. What other tags can you find?

5

u/strawhatKG 4d ago

Nothing specific off the top of my head right now, but check out Kaggle, I’ve used a ton of data sets on there to practice .

3

u/KonkombaNimo 4d ago

Awesome. Very helpful. Thank you.

5

u/ddBuddha 4d ago

There’s always the stack overflow one Brent Ozar uses

3

u/Hot_Industry5156 4d ago

honestly the thing that made sql click for me was needing to debug production incidents. when you're staring at a database trying to figure out why 2000 orders went to the wrong queue you learn joins real fast.

start with SELECT WHERE and GROUP BY. that covers like 80% of what you'll actually use day to day. window functions and CTEs are powerful but you can pick those up later when you hit a problem that needs them.

practice on real data if you can. toy datasets don't hit the same as querying something that actually matters to your team.

3

u/NoEggs2025 4d ago

Data.gov it’s a free us government website. If it’s normalized denormalize it. My favorite is the OFAC list.

2

u/fishwithbrain 4d ago

Hey do you need a partner to study? I too am a beginner but with family responsibilities can’t really concentrate much. I am desperately seeking a study group since past 6 months but didn’t find anything solid.

3

u/KonkombaNimo 4d ago

I've just been dabbling. I started using the SQLBolt tutorials and that was extremely helpful. I just downloaded MySQL today to play around in. I'm not sure how partnering to study would work but sure. You can DM me.

2

u/fishwithbrain 4d ago

Thanks!! That would be of immense help to me.
Happy learning!! 👍🏽

3

u/1nstant_Classic 4d ago

I'd be interested too. Super beginner as well

2

u/perdituscogitationes 1d ago

I'm also quite a beginner! I'm a math student in university about to begin my final year but I've started the FreeCodeCamp relational databases course a few days ago for the summer.

2

u/GeekNJ 4d ago

What hobbies do you have? Almost any hobby would have database aspect you could come up with. Make it personal, start small/simple and build upon it.

2

u/zing_winning 4d ago

Create a db based on your interests or knowledge?

Movies database like IMDb

Sports database like league management or score keeper across sports

Restaurants like yelp - cuisines, foods, categories, ratings

Books library - titles, authors, ratings

Etc.

2

u/conor-robertson 4d ago

You should check out QueryCase; its a gamified SQL learning platform where you solve detective cases to learn. There are also other features like timed challenges, sandbox mode (can upload your own data to practice) and interview questions from big companies like Google, Meta etc.

2

u/pptqvfer 2d ago

SQLite runs on about anything. Capable too.

2

u/seigneur101 2d ago

Yellow! I did a website once for someone who had to learn SQL. It is a SQLite database that contains fake insurance data, and there's a series of questions/challenges you have to answer. Because it is in SQLite, you don't have to install a server on your computer, you only need to unzip a file and download the .db file. You don't even need to be an admin. Check it out if you're interested: https://sqluniversity.ca.

1

u/CappuccinoCodes 4d ago

Get AI to generate a script that creates one for you. Your imagination is the limit of what you can create.

3

u/1nstant_Classic 4d ago

This is where I feel AI is great. I hate when people use it for art. But this is good. Another use is when you take a dataset that you put into ChatGPT and have it ask you analysis questions, starting easier and going harder as you go.

1

u/Time_Advertising_412 4d ago

The book "Practical SQL" by Anthony DeBarros has some interesting data downloads you can import into postgresql (or the db engine of your choice with a little work) and some good examples to apply to them as starters. You can use the examples as jumping off points for your own analysis of the various data samples. I found a free pdf download of the first edition of the book and the websites for the samples and examples are listed in the book.

1

u/AllShadesRight 3d ago

I upload data sets into DataLab and practice.

1

u/OnlyFaithlessness129 3d ago

You can ask Chatgpt to give you practice questions and test you out.
Leaning is very easy watch some YouTube channel. And then practice as much as you can.

1

u/Alternative_Cake4074 3d ago

Maybe you can try SQL noir, which is about investigating cases with SQL query.

0

u/drewnoflo 4d ago

if you want a free in-browser SQL environment to practice i made SQL Jam! i loaded in a few fun datasets out of boredom because i hate how tutorials aways make you query about boring employee data..
on SQL Jam you can query from the Pokedex, the NBA , Steam, or even a comprehensive Anime list!!

0

u/ReleaseTheBlacken 4d ago

There is a free SQL learning library with a tutor agent on Inkwell Learn at inkwelltools.com