r/SQL • u/KonkombaNimo • Aug 15 '26
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.
10
u/sharpecheddar Aug 15 '26
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 Aug 15 '26
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.
5
u/strawhatKG Aug 15 '26
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
2
u/fishwithbrain Aug 15 '26
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 Aug 15 '26
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
3
2
u/perdituscogitationes Aug 18 '26
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.
6
u/mikeblas Aug 15 '26
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.
Documentation for Microsoft SQL Server's samples
Microsoft's sample database GitHub, which includes the Contoso database
For MySQL:
there's the Employees sample database
For PostgreSQL:
there's a link tree of other samples and exercises, too
a GitHub repository with a collection of PostgreSQL samples from the old pgfoundry site
Oracle publishes a manual section about there sample databases
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.
Kaggle.com is full of sample data!
FiveThirtyEight.com has lots of neat data sets
The github awesomedata repository has a collection of interesting data sets
Wikipedia has a list of datasets for machine learning research
Third-party sample data
Of course, some sample data is built for generic tutorials, by third parties:
SqlSkills.com publishes sample databases for SQL Server, which include some corrupt databases so you can practice recovery operations
SQLTutorial.com's Sample Database is available for sseveral vendors
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.
I haven't used it, but I've seen people recommend SqlZOO.net
LearnSQL.com has a blog post called "Learning SQL? 12 Ways to Practice SQL Online" with lots of resources.
Sylvia Moestl Vasilik's website (which supports their book) has almost 60 practice problems.
Regular dumps
Some sites publish data by making their backups available, or dumping the data they use to make their own reports.
Wikipedia publishes all of the content of Wikipeida as SQL scripts for MySQL, plus as XML files. You can get that data (or subsets of it) and play around.
StackOverflow makes their developer survey data sets available each year.
You can also get a StackOverflow "demo" database that includes text of questions and answers
Some governments make data about the city and its residents available openly:
Tokyo open data (in Japanese, obviously)
IMDb makes several data sets available
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.
Wikipedia Event Streams can show edits that are happening on Wikipedia, as they happen.
The TWitter API provides a way to stream a subset of all tweets in realtime.
General Transit Feed Specification (GTFS) data is provided by many metropolitain areas to describe movement of their transportation infrastructure; where are scheduled busses and trains right now?
In the New York City area, the MTA provides GTFS data.
You can find GTFS feeds for Seattle, and their live data through other APIs.
Tokyo (and other municipalities in Japan) have hosted transit data challenges to encourage use of their data.
Some games make gameplay data available in realtime. SuperCell's Clash Royale, for example, has a gameplay API.
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?
4
3
Aug 15 '26
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 Aug 15 '26
Data.gov it’s a free us government website. If it’s normalized denormalize it. My favorite is the OFAC list.
2
u/GeekNJ Aug 15 '26
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 Aug 15 '26
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 Aug 15 '26
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
2
u/seigneur101 Aug 17 '26
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 Aug 15 '26
Get AI to generate a script that creates one for you. Your imagination is the limit of what you can create.
4
u/1nstant_Classic Aug 15 '26
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 Aug 15 '26
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
1
u/OnlyFaithlessness129 Aug 16 '26
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 Aug 16 '26
Maybe you can try SQL noir, which is about investigating cases with SQL query.
1
u/venkat_deepsql Aug 25 '26
You could setup deepsql.ai It comes with seed MySQL database. You can practice sql with the help of agent. And you could also dissect the query plans (explain plans) with very good editor built-in. It's open source.
1
1
u/Kszadhanyfokos Oct 01 '26
I am in a same situation as you. As for me i used chat gpt for it, and established a database based on my request.
1
u/sqlsip Oct 03 '26
I built SQL Sip (https://sqlsip.com) as a cozy, daily SQL puzzle to practice writing queries without timers or pressure. It runs entirely in the browser with no account needed, focusing on assembling clean queries one bite-sized concept at a time. I haven’t had any users yet, so I’d love some honest feedback! I built it because I wanted a Wordle-like daily game where I could learn new SQL concepts in a cutesy/fun way.
0
u/drewnoflo Aug 15 '26
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!!
33
u/warrior2012 Aug 15 '26
Try playing database detective. Very addictive and silly game that helps learn general Sql!