I created this roadmap to guide you through mastering SQL basics in just 6 weeks (or sooner if you have the time and are motivated) for free, focusing specifically on skills essential for aspiring Data Scientists or Data Analysts.
Here is what the roadmap looks like:
- Week 1: Learn the SQL basics and how to retrieve data.
- Week 2: Master aggregations and
GROUP BY
for data summarization. - Week 3: Dive into relational databases and
JOINs
to combine datasets. - Week 4: Learn Window Functions for advanced data manipulation.
- Week 5: Advance your skills with CTEs and sub-queries for complex queries.
- Weeks 6-7: Build your own projects to apply everything you've learned.
Then don't just watch the tutorials and read the articles, practice every step of the way to ensure you gain a good understanding of the different concepts. You can use this online SQL server by W3Schools to practice SQL commands without needing to install anything. I also share other great resources at the bottom of this respository.
Alright, let’s get started! 🚀
Your first week is about understanding what SQL is and learning how to retrieve data from a database, which is essential for Data Science & Analytics.
- What is SQL? Youtube Video
- Install MySQL: Youtube Video
- Basic Commands:
SELECT
&FROM
: Youtube VideoWHERE
: Youtube Video
💡 Tip: You can start practicing what you just learned using the online SQL server by W3Schools.
In your second week, you'll learn how to summarize data for insights using aggregation functions. This is critical for creating reports and dashboards.
- Aggregations (COUNT, SUM, AVG, MAX, MIN): Youtube Video
- Using GROUP BY (HAVING & WHERE): Youtube Video
💡 Tip: When working with aggregations, start with smaller datasets to avoid performance issues and make debugging easier.
Understanding relational databases and mastering JOINs
to combine tables is key for more complex analysis in Data Science & Analytics.
- What is a relational database?: Youtube Video
- Introduction to JOINs:
💡 Tip: Practice JOINs
with different types of datasets to understand how they combine data. Try to visualize what the result will look like before running the query.
Now that you’ve mastered the basics of combining data with JOINs
, you can take things to the next level by learning window functions. These are useful for performing calculations like ranking, running totals, or moving averages across subsets of data.
✋ Note: This section is more advanced. If you're still getting comfortable with basic SQL, feel free to skip this for now and return later.
- What are Window Functions? Youtube Video
- Common Window Functions:
ROW_NUMBER()
,RANK()
andDENSE_RANK()
: Youtube Video- Window Functions Cheat sheet: Article
💡 Tip: Check out how 5 real examples of how I use window functions as a Data Scientist in tech
In week 5, you’re now ready for multi-step queries. You’re really advancing in your SQL skills at this point, and you should be proud of yourself!
- Learn about CTEs: Youtube Video
- Learn about sub-queries: Youtube Video
💡 Tip: When working with CTEs and sub-queries, break your queries down into smaller parts and test them individually before combining them.
Now that you have the foundational skills, it's time to apply them in real-world scenarios by working on projects.
- Start with a guided project: Youtube Video
- Ideas for your own projects:
-
Customer Segmentation Analysis
- Objective: Analyze customer behavior and group them into segments based on purchasing habits.
- Dataset: Use an open dataset like the UCI Online Retail dataset or any e-commerce dataset.
- Outcome: Create distinct customer profiles (e.g., high-spenders, occasional buyers) and generate a report to inform marketing strategies.
- Difficulty: Beginner to Intermediate
-
Movie Recommendation System (SQL-Based)
- Objective: Build a simple movie recommendation system based on user ratings.
- Dataset: Use the MovieLens dataset, which includes user ratings for movies.
- Outcome: Generate a list of recommended movies based on user preferences and ratings patterns.
- Difficulty: Intermediate to Advanced
-
💡 Tip: Take time to document your projects. Writing clear descriptions of the problem you’re solving and your approach will help solidify your understanding and build your portfolio.
Here are 5 great websites where you can practice SQL and keep your skills sharp
💡 Tip: If you are unsure which one to choose, the SQL 50 by LeetCode is usually a great starting point and DataLemur is specially great for practicing for DS/DA interviews.
Here are some more resources to help you on your Data Science journey:
- 📚 Data Scientist Handbook: A curated list of resources (Free & Paid) to help data scientists learn, grow, and break into the field of data science.
- 💌 To Be a Data Scientist (Newsletter): Weekly insights to break into Data Science and advance your career (Join 2K+ Data Science already accelerating their careers).
If you have questions or feedback send me a message through here. Enjoy!