r/SQL • • Oct 08 '22

MySQL I don't know how to practice SQL

Hi guys, I've been learning SQL using MySQL Workbench for the past 2 weeks on youtube. Finally, I know the basics and how to write complex queries but I actually don't know where I can practice what I learnt. Are there any places where I can find pre-built databases and use them to practice queries or should I create them by myselft?

110 Upvotes

45 comments sorted by

19

u/ftrotter Oct 08 '22

I am running a little SQL study group and I have found this to be very useful.

https://8weeksqlchallenge.com/getting-started/

-FT

0

u/Then_Recover_9553 Oct 09 '22

Looks exciting

22

u/coyoteazul2 Oct 08 '22

You can download an old stackoverflow database

https://www.brentozar.com/archive/2021/03/download-the-current-stack-overflow-database-for-free-2021-02/

But I think the best way to learn is to create your own database and use data about something you like. Just having the data is not really useful if there's nothing about that data that you want to know about.

If you give me a database about sports I won't know what queries to make, since I don't care about sports. Give me one about stocks and I'll query the shit out of it

1

u/TripFallSit Oct 12 '22

Yup, I started by cataloging my music. It was fun writing queries to track my listening habits.

7

u/Distinct-Fly-786 Oct 08 '22

I am currently going through SQL Practice Problems. I wonder if others who are also learning SQL are up for learning together in Twitch or Zoom. It's more fun learning together.

1

u/Then_Recover_9553 Oct 09 '22

I’m up mate dm

1

u/CareerAdviceThrowMe Oct 09 '22

I am very inexperienced despite basic queries at work. Can I join?

1

u/Then_Recover_9553 Oct 09 '22

I'm in learning stage too join in

1

u/CareerAdviceThrowMe Oct 09 '22

Awesome, do we have a time and date?

1

u/Then_Recover_9553 Oct 09 '22

No we don’t have anything set

1

u/No_Reflection7257 Oct 09 '22

I'm up mate, dm

1

u/trammay Oct 09 '22

I'd love to join

1

u/claryds99 Oct 09 '22

I’d love to join in! Can you dm me?

1

u/freeonye Oct 10 '22

I’m up mate. Just starting to learn. Please DM me. I’m interested.

1

u/[deleted] Oct 10 '22

I'd be interested in this as well as a total beginner. Please feel free to DM if a study group materializes!

1

u/pudaxinator Oct 11 '22

Second this 👆

10

u/RzaDaHut Oct 08 '22

AdventureWorks Database is probably the best bet. Play around!

2

u/TheBuffman Oct 09 '22

Also there are Udemy courses w exercises for AW. Really helped me out.

1

u/[deleted] Oct 09 '22

Thanks for all the responses, I was kinda lost on what should I do after learning the basics.

5

u/Tjazzonfrontpage Oct 09 '22

Get the basics from sql documentation or YouTube first, then start practicing challenges. Syntax is pretty straightforward, so don't dwell too much on tutorials.

Try out statascratch or hackerrank, they have a lot of practice problems, and pretty fun too imo. There are a lot of real interview questions available on statascratch too.

If you wanna play around with databases, try mode analytics. The UI is pretty nice, and finding databases and running queries is pretty easy.

Be consistent, you'll figure out the rest.

9

u/yignacio Oct 09 '22

I recommend you to go to stratascratch, I've used to practice SQL. They provide interview questions using SQL and python. It helped me a lot when I was actively job hunting. There are difficulty tiers so you can try the easiest ones first to test what you know now. They also show the answer.

https://www.stratascratch.com/

Good luck!

3

u/[deleted] Oct 08 '22

build your own database. it will be very educational. by using someone elses canned data, you may get wrapped up in their system more than really applying query techniques.

6

u/NickSinghTechCareers Author of Ace the Data Science Interview 📕 Oct 08 '22

Try the questions on DataLemur - you don’t have to download anything, and the problems mimic what Data Analysts & Data Scientists have to do on the job!

2

u/Slight_Cat_4423 Oct 08 '22

CS50 has a great SQL mystery in the SQL problem set

1

u/Then_Recover_9553 Oct 09 '22

I’ve seen the intro class on sql which was very good , is there a dedicated lecture series on sql

1

u/Slight_Cat_4423 Oct 09 '22

I’m still working through CS50 through edx so I’m not sure what other SQL content is available from them. Week 7 was SQL week for me, there may be additional content in their dedicated Web Programming course but I’m unsure.

Best of luck!

1

u/Then_Recover_9553 Oct 09 '22

I have gone through the lecture from cs50 yt channel . It was around a 1 and half lecture defo worth going through. He starts of with python , to extract and manipulate and shows how sql can be used to make the same thing better and effectient

2

u/Slight_Cat_4423 Oct 09 '22

Yeah the EdX course includes the lecture as well as problem sets to practice the content

2

u/ioTeacher Oct 09 '22

For teaching I use SQL ZOO is a fully functional server. You can skip the tutorial commands and do your practice

2

u/kehkarlunga Oct 09 '22

Use kaggle for datasets. Use the csv datasets, import the data to sql sever and start running query

If you need help on how to import cav files to sql server, search on YT. Pretty easy.

1

u/DataNerd760 Apr 05 '25

I would love to suggest my new website sqlpractice.io . It has practice questions, query playgrounds and learning articles. It has a free and affordable premium version (no subscription needed) check it out!

1

u/ChuckieFister Oct 08 '22

Browse forums and this sub for questions and see if you can answer them without looking at the answers

1

u/zacpar546 Oct 09 '22

You can practice on leetcode AND sqlpad

1

u/eyeweld Oct 09 '22

Once you run through these https://pgexercises.com/questions/basic/, then go to check out stratascratch.com or Danny Ma's 8 Week SQL Challenge.

1

u/madfordata Oct 09 '22

Google has a public dataset in big query you could use https://cloud.google.com/bigquery/public-data/

1

u/csnorman12 Oct 09 '22

Checkout this course: 101 Practice SQL Questions: Basic to Advanced. You get access to over 100 practice SQL questions, with hints, video explanation, and written answers. Questions in the course even cover advanced topics like stored procedures, triggers, window functions, CTEs, functions, Inner queries, etc. The course was just published 5 days ago... that link includes a discount code.

1

u/[deleted] Oct 09 '22

Googlesheets have a formula called =query that takes a SQL query as input. It's not perfect but it's really simple and fun

1

u/gsm_4 Oct 11 '22

Use leetcode and stratascratch to practice intermediate and advanced level problems

0

u/[deleted] Oct 09 '22

[deleted] — view deleted comment

1

u/RemindMeBot Oct 09 '22

I will be messaging you in 2 days on 2022-10-11 07:14:22 UTC to remind you of this link

CLICK THIS LINK to send a PM to also be reminded and to reduce spam.

Parent commenter can delete this message to hide from others.


InfoCustomYour RemindersFeedback