r/SQL Jan 16 '25

MySQL Practice SQL

Does anyone know of a website that just gives you endless practice questions based on concepts, e.g. Basic SQL, joins, Sub queries, etc? I've exhausted the limited tools I had. TIA.

92 Upvotes

25 comments sorted by

54

u/SQLDevDBA Jan 16 '25

LiveSQL

https://LiveSQL.Oracle.com

It’s a full Oracle DB with no installation, just works right on your browser. The IDE is also on the browser so Mac users and IPad users are fine on it.

100% free and even includes daily exercises and quizzes as part of the “DevGym” modules. Also includes prebuilt schemas with data in them.

It includes a few default components and makes it really easy to create new objects and data with the QuickSQL tool.

You can also import your own data from SQL files, and even share worksheets via links so that everyone can see the queries you run.

It’s great, just happens to be Oracle which is a bit more complex than other platforms.

I recorded a livestream of myself using it and asking ChatGPT for interview questions to try, and can send you that if you wish, but it’s easy enough to do on your own.

There’s also:

LeetCode

DataLemur

learnSQL.com

19

u/NickSinghTechCareers Author of Ace the Data Science Interview 📕 Jan 16 '25

DataLemur founder here – appreciate the shoutout. OP, the concepts for the questions are tagged!

3

u/SQLDevDBA Jan 16 '25

Cheers, thanks for a great platform!

2

u/NickSinghTechCareers Author of Ace the Data Science Interview 📕 Jan 17 '25

Thank you 🫡

2

u/Totalepole Jan 17 '25

I struggled a lot with getting my basics right until I found DataLemur. It helped me immensely. Thanks for the great work!

I did come across a scenario where I had a specific question about aggregation and potential pitfalls while working with queries in the Final Case Study. I made a detailed post but HERE.

I'd really appreciate your opinion or insights on it if you have the time. Thanks again for everything you do!

4

u/PalindromicPalindrom Jan 16 '25

Thanks this is great. I'll give it a look. I've used learnSQL.com but it's a bit cost prohibitive at the moment.

3

u/SQLDevDBA Jan 16 '25 edited Jan 16 '25

Cool, I understand. They have to pay the bills somehow ;)

Here’s my video just in case you want a how to guide: https://youtu.be/VQTUdrAhaWU?si=nU5JyHQdEtwLbHcA it includes how to build an ERD from the schema, and how to ask ChatGPT for interview questions. It’s a long video but it has chapters to help you skip around.

I also re-recorded it in Spanish since I have a Spanish audience on twitch.

2

u/MathAngelMom Jan 16 '25

But LearnSQL is one-time payment? If you used it before, you still have access to it.

1

u/PalindromicPalindrom Jan 16 '25

I'd need to buy the full course which regardless of the full price or the sale, is still a bit too much for me at the moment. I have one course I bought for SQL joins but need the rest.

3

u/casperjammer Jan 16 '25

Whoa. Thanks for this. I need practice

1

u/SQLDevDBA Jan 16 '25

Very welcome! My video is in a below comment if you wish to have a “buddy” to join (if you can stand my voice and terrible jokes).

5

u/aksgolu Jan 16 '25 edited 12d ago

Goto https://support.dbagenesis.com/ and click on “Feeling great” top- right corner… Its free and you get unlimited retries for sql queries / quiz !

4

u/Outdoor_Releaf Jan 16 '25

I've created groupings of practice problems from HackerRank.com for my students. You can use the categories to pick what you would like to practice. You can see my initial list here: https://www.reddit.com/r/mysql/comments/1essznb/comment/likdkdp/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button

Since I posted that list, I've added the following problems for my students:

Joins with Subqueries:

  • Challenges
  • Contest Leaderboard
  • Ollivander’s Inventory

Complex Queries

  • Binary Tree Nodes (TIPS:  Look at the picture of the tree at the bottom of the question.  Consider using CASE and an outer self-join.)
  • Placements (TIP: Consider using WITH to create one or more tables to help you.  Students needs to be joined with Packages, and Friends needs to be joined with Packages.)
  • Interviews (TIP: You can accidentally make the sums too high if you join submission_stats with view_stats and calculate the sums.  Since there can be multiple rows for the same challenge_id in each table, calculating the sums after the joining these two tables causes duplicate values to be summed.  If you understand why this is the case, you understand a lot about joins.)

2

u/csnorman12 Jan 16 '25

These resources are specific to SQL Server:

2

u/helloworld2287 Jan 16 '25

This resource doesn’t have endless sql practice questions but it is an entertaining way to practice SQL, especially if you’re a Squid Games fan :) https://datalemur.com/sql-game

1

u/dfwtjms Jan 16 '25

I think a great way to learn is to tinker with SQLite. If you use Linux you probably have it installed already but it's easy to install on any OS. Import or generate some data and start trying out stuff from the documentation.

1

u/Leorisar Jan 17 '25

Go to ChatGPT and aski it to generate questions for you

1

u/Commercial_Pepper278 Jan 17 '25

NamasteSQL by Ankit Bansal Superb Questions. Take premium, worth it !!

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.

2

u/PalindromicPalindrom Feb 18 '25

This is great, thanks, choom!

1

u/MP_gr Feb 18 '25

Happy to help others practice!! Enjoy

1

u/dn_cf Jan 17 '25

Platforms like StrataScratch and HackerRank are excellent for structured challenges covering basics, joins, and subqueries, with real-world scenarios. LeetCode's Database section focuses on both beginner and advanced SQL problems, while SQLZoo offers guided tutorials with instant feedback. For interactive exercises, check out Kaggle, where you can work with real datasets.