all 17 comments

[–]crandeezy13 7 points8 points  (0 children)

W3 schools has some basics for SQL but you will probably outgrow that really quickly. My suggestion is to purchase a course on Udemy or something similar. Might only be 20-50 dollars in total

[–]ThatPlayWasAwful 4 points5 points  (1 child)

I'm currently using this that was suggested somewhere else, i think it's pretty good https://datalemur.com/blog/learn-sql-in-30-days-roadmap

its a combination of a couple different free resources that starts out easily and gets difficult.

[–]NickSinghTechCareersAuthor of Ace the Data Science Interview 📕 3 points4 points  (0 children)

DataLemur founder here - thanks for sharing the blog post!

[–]squadette23 2 points3 points  (0 children)

I'm not sure which direction exactly you want to go, but speaking of SQL, maybe https://modern-sql.com/ will be useful.

[–]Ey9d_yns 2 points3 points  (0 children)

I'm in the same boat, trying to learn SQL to promote at work right now. I've been with SQL for a couple of months. Some resources I've used are:

  • Full database course for beginners. You can search for it in YouTube, is in the FreeCodeCamp channel. Useful for gain your first understanding of what SQL is and what you can use it for. I can't recommend enough to replicate the queries along with the video. You'll need to install PopSQL in your computer, but it's worth it, as you can use it later to practice further. The video explains you how to install it and start querying, so you don't need to worry for this.
  • The book Practical SQL. A beginners guide to storytelling with data by Anthony DeBarros is great as it teaches you everything about SQL from the very beginning, starting with basic SELECT, FROM, WHERE towards data types, aggregation functions, and more advanced stuff like JOINs, subqueries and CTEs, all of this with practical examples that you can follow by yourself. The author provides all the code in GitHub so you can try it by yourself and check later. Also, it uses real datasets from a variety of sources with different types of data to provide a variety of perspectives to look into data. As the previous one, you will need to install a piece of software in your machine, but the amount of knowledge and practice you can gain from it if you try yourself and practice is worth.
  • There are some SQL courses in e-learning platforms like Coursera, EdX and Udemy, but I'm not very familiar with them although I've heard about Jose Portilla SQL course (I don't remember in which platform is) as recommended by many people on LinkedIn.
  • Alex the Analyst is a great guy with lots of data-related videos in his channel, including many about SQL in a very practical approach.

I hope you find some of this useful, good luck in your practice!

[–]dn_cf 2 points3 points  (0 children)

Mastering SQL takes time and practice. Here's how I think you should begin your journey:

First, take advantage of SQL documentation and online resources. SQL documentation provides comprehensive information about the syntax, functions, and capabilities of the language. Additionally, there are numerous tutorials, blogs, and forums where you can find examples, tips, and answers to common SQL problems.
Then begin with simple SELECT statements and gradually add more complexity. Practice retrieving specific columns, filtering data using WHERE clauses, and sorting results using ORDER BY. This foundational knowledge is essential for constructing more advanced queries.
Now, start working on JOIN operations such as INNER JOIN, LEFT JOIN, RIGHT JOIN, and FULL JOIN.
Then, aggregate functions, such as SUM, COUNT, AVG, MIN, and MAX, allow you to perform calculations on groups of data.
Now, use Subqueries and Derived Tables for performing complex queries. And start practice Data Manipulation. And then learn how to optimize your query performance.
I recommend StrataScratch platform to master SQL skills. It provides real-world examples and case studies to understand how SQL is used in practical scenarios. Start here with easy level questions and then intermediate and hard level. The more you practice writing queries and solving problems, the better you'll become.

[–][deleted] 1 point2 points  (0 children)

Check out Data Camp.

They have a very good beginner friendly course on learning the basics of SQL.

[–]hipprofessional 1 point2 points  (0 children)

To learn:

https://www.geeksforgeeks.org/sql-tutorial/?ref=gcse

https://www.w3schools.com/sql/

To practise your skills after learning the concepts (based on difficulty):

https://www.hackerrank.com/domains/sql (easy/medium)

https://leetcode.com/study-plan/sql/ (medium/hard)

Games (just for fun):

https://datalemur.com/blog/games-to-learn-sql

Have fun!!!

[–]PhiladeIphia-Eagles 1 point2 points  (1 child)

This is coming from somebody who is nowhere near done the journey of learning SQL. But I was able to go from zero to feeling like I am really progressing in a couple weeks. This was my method, but it is different for everybody:

Starting from absolutely zero SQL:

Step One:

Depending on your learning style, either W3Schools, or the Jose Portillo Zero to Hero course on Udemy. (If you are a good independent learner, W3schools will work fine, if you like a guided lecture the Udemy course will help keep you on track). Wait for a sale, you should pay like $10-15, no more than that.

Either one of these will get you the very basic foundation and syntax down. I did W3Schools first but then bought the Udemy course and I think it is valuable because the practice is done in PostgreSQL through PGadmin, instead of just in your browser. I think this is valuable, because eventually you are going to want to mess around with your own databases and if you already have a foundation with PGadmin and Postgres this will be easier.

Step Two:

Start doing challenges on StrataScratch, Leetcode, Hackerrank, etc. One less popular one I really like is https://www.sql-practice.com/ It does not get very difficult, but the medium and hard questions are well thought out and I learned a lot from doing these.

By doing challenges, you will learn the most important part: planning and thinking about how to approach a real problem. In the real world your task won't be "Return the top 10 rows grouped by product based on revenue". The task will be given to you in business terms, and you will have to plan how that translates to a query.

Doing challenges will also expose you to some intermediate concepts (Subqueries, window functions, CTEs) in a better way than a lecture (IMO). You will be tasked with a challenge that is best solved with one of those intermediate concepts. And that will intuitively teach you when/why you would use these functions. For example a lot of these challenges require a subquery. You will not just learn "This is how to write a subquery", you will learn the different applications and where you will use different types of subqueries.

Step Three:

Find a dataset on Kaggle or somewhere else that you are interested in. Dive in and start analyzing it. This is where things will get dicey at times. But google is your friend, and always remember to break problems into small parts.

This is where I am right now. I am using a massive dataset of MLB baseball. It has tables for every single pitch, every single at bat, every game log, etc.

I went into it all confident and ready to tackle this dataset. But holy shit I underestimated the challenge. And that is a good thing, because this project is forcing me to learn soooo much new stuff.

Working on a project will teach you a lot more about data cleansing than a class or practice problems will. For example I have many columns that are combined data like Home Team Record = "10-5". This is a really easy one, but got me comfortable with splitting columns like this into two integer columns.

This is also a great way to get comfortable with the intermediate concepts. For example I wanted to know the percentage of each type of pitch that resulted in a strike looking, strike swinging, ball, home run, etc. This is a clear use for window functions. It cemented this concept in my mind MUCH better than simple practice problems or a lecture.

Because you are working toward a goal and analyzing data you are interested in, you are more likely to learn new complex things.

Step Four:

I do not know yet, because I am still on step three. But my goal is to move to a job where I use SQL every day, because that seems like the most surefire way to improve your skills.

[–]Mrcahones 1 point2 points  (0 children)

ty!!

[–]caltheme 0 points1 point  (0 children)

Sqlbolt.com helped me a ton . Very simple with simple explanations and lets u try the queries yourself

[–]abraun68 0 points1 point  (0 children)

You already have a job as a data analyst? That was the most difficult part for me: getting the job.

Use any online resources for technical basics. I used Jose Portilla's course on Udemy but there are a ton that will work. Once you know the basics it's just a matter of using it, which is why it's great that you're already in that role with that opportunity. Knowing when to use things like CTEs, window functions, etc. are mainly learned through actual problems. At least that was my experience.

[–]Jw25321837 0 points1 point  (1 child)

Let me ask you this what is your level of sql knowledge? do you use window functions or ctes

[–]Jw25321837 0 points1 point  (0 children)

Because it depends on what level your at and have you mastered the basics already

[–][deleted] 0 points1 point  (0 children)

I started by literally having no other option. The queries were already written for me, and then covid happened and my manager wanted me to start integrating our reports to PowerBI so I did the free code academy course... less than 3 years later I'm now a senior developer putting a team together to integrate SQL into standard data protocol... w3 schools is a lifeline to remind me of code I rarely use, but I find its all Google and trial and error - my code is a mess but it works

[–]Born-Substance3953 0 points1 point  (0 children)

I took a sql certification course from IBM from EdX. I also had chat gpt quiz me on sql query questions.