Are you looking to break into data science? If yes, learning SQL can help you gain foundational data skills, as well as ace technical interviews.
Regardless of the data role that you are applying for: data analyst, data scientist, or data engineer, proficiency in SQL is mandatory. The prerequisites for being good at your data role:
- Querying data from databases
- Performing analysis
- Putting your analytical skills to test to answer business questions
We’ve put together this list of useful SQL tutorials that are free to access and cover SQL fundamentals. For each of the listed courses, we will provide an introduction to the course, its contents, and prerequisites (if any). If it is a compendium of courses, we list what each of the parts will cover.
Next, we’ll also help you with platforms where you can find SQL for practice and get ready to tackle the interviews for your favorite data roles.
List of Free SQL Tutorials
- Mode SQL Tutorial
- DataCamp Introduction to SQL
- Kaggle Learn SQL Tutorials
- Pluralsight SQL Courses
- Udacity SQL for Data Analysis
- LinkedIn Learning SQL Courses
- Programming with Mosh MySQL Course
- freeCodeCamp Relational Database and SQL Courses
- Codecademy Learn SQL
- Cognitive Class SQL and Relational Databases 101
Useful Resources to Practice SQL
- HackerRank
- StrataScratch
- 8-Week SQL Challenge
- LeetCode
List of Free SQL Tutorials
1️⃣ Mode SQL Tutorial
Mode has an in-depth SQL tutorial.
The entire tutorial is organized into sections:
- Basic SQL: Learn to use SQL in Mode’s query editor, SELECT statement, WHERE and LIMIT clauses, comparison and logical operators, NULL, and more.
- Intermediate SQL: Learn about aggregate functions, joins, and unions in SQL
- Advanced SQL: Learn SQL data types, date formats, data wrangling, SQL string functions, subqueries, window functions, and performance tuning of SQL queries.
- SQL Analytics Training: Go through some real world case studies.
2️⃣ DataCamp Introduction to SQL
DataCamp has an Introduction to SQL course that aims at teaching you the fundamentals of SQL programming. This course is designed as a series of interactive coding exercises, which you’ll have to complete as you progress through the course.
Introduction to SQL serves as an introduction and the building block for other tracks such as SQL Fundamentals and Data Analyst in SQL Career Track.
You can access this course for free by signing up for a DataCamp account. However, to access the above-mentioned tracks, you will need a DataCamp subscription.
This Introduction to SQL course has the following four modules:
- Selecting columns
- Filtering rows
- Aggregate functions
- Sorting and grouping
3️⃣ Kaggle Learn SQL Tutorials
Kaggle is a great platform to hone your practical data skills. Apart from datasets and kaggle kernels, they also have kaggle learn, a library of courses that can help you learn the required data skills. All courses are designed such that they cover the requisite theory, followed by a hands-on component.
Kaggle learn has a compendium of SQL tutorials:
- Intro to SQL
- Advanced SQL
In both of these, you will use Google BigQuery. Google BigQuery is an enterprise data warehouse that lets you use SQL queries for data retrieval and analysis—without the need to manage complex infrastructure. You will learn the workflow to handle potentially large datasets with BigQuery and use SQL to analyze the data.
Intro to SQL
Intro to SQL, the first of the two courses, covers the following:
- Getting Started with SQL and BigQuery
- Understanding SELECT, FROM, and WHERE
- Learning to group your data and query the same by understanding GROUP BY and HAVING
- Sort results of SQL queries using ORDER BY
- Using AS for aliasing, AS and WITH to write common table expression (CTE) to split queries into smaller chunks
- Pulling and analyzing data from multiple tables using JOIN
Advanced SQL
Advanced SQL, the second course, covers the following:
- JOINs and UNIONs
- Analytic Functions
- Handling Nested and Repeated Data
- Writing Efficient Queries
4️⃣ Pluralsight SQL Courses
PostgreSQL is a popular open source database platform. Pluralsight has two courses that’ll help you learn SQL using PostgreSQL and the pgAdmin tool.
Querying Data from PostgreSQL
Querying Data from PostgreSQL is an introductory course that’ll help you learn the fundamental concepts such as using SQL queries to retrieve data, filter and aggregate your results, and join data from multiple tables.
Here’s an overview of the course’s contents:
- Understanding the Relational Model
- SELECTing Your Data
- Limiting Your Result
- Joining for Further Insights
- Presenting and Aggregating Your Results
PostgreSQL Data Manipulation Playbook
The next course in the library of free data courses is PostgreSQL Data Manipulation Playbook.
Prerequisites: This course assumes you have some familiarity with SQL, and can write queries to retrieve and analyze data from PostgreSQL.
When multiple users access a database application, concurrency issues may occur. This course aims at teaching how you can use advanced techniques to solve concurrency challenges, and tackle data modifications in multi-user database applications.
Here’s an overview of the course’s contents:
- Understanding SQL Sublanguages
- What are Concurrency Challenges?
- Understanding ANSI Concurrency Phenomena
- How Isolation Levels Solve Concurrency Challenges
- Using Transaction Control Language (TCL)
- Inserting Data with INSERT Statement
- Using the UPDATE Statement
- Deleting Data Using the DELETE Statement
- Performing Bulk Deletes
5️⃣ Udacity SQL for Data Analysis
Udacity’s free course library also has a SQL for Data Analysis course by Mode Analytics. This is a self-paced course that takes approximately 4 weeks to complete. The course is laid out into 6 lessons, and all lessons have videos and interactive quizzes.
Here’s an overview of the course curriculum:
- SQL Basics
- SQL Joins
- SQL Aggregations
- Subqueries and Temp Tables
- SQL Data Cleaning
- Window Functions
6️⃣ LinkedIn Learning SQL Courses
If you’re on LinkedIn, you can access LinkedIn Learning, a platform that offers online courses taught by experts. With a LinkedIn premium subscription, you can unlock the entire course library. However, LinkedIn Learning also has a subset of free courses.
Learning SQL Programming by Scott Simpson is a quick way to understand the fundamentals of SQL. The instructor, Scott Simpson will walk you through examples using a sample database with SQLite as the database engine of choice.
Before diving into SQL, it’s often helpful to learn the foundations of relational databases and the Programming Foundations: Databases course also taught by Scott Simpson is a good reference.
SQL: Data Reporting and Analysis by Emma Saunders is another free SQL tutorial.
This course covers:
- Basic SQL Queries
- Grouping and Filtering Data
- Merging Data from Tables Using Joins
- Views, SQL Indexes, and Procedures
7️⃣ Programming with Mosh MySQL Course
Mosh Hamedani is an educator who runs the YouTube channel Programming with Mosh. In it, he offers a course focused on MySQL, one of the most widely used relational database management systems.
From installing MySQL on your local machine to performing joins, this course will help you learn the basics of SQL in about three hours.
If you are looking for a quick tutorial to ramp up on SQL fundamentals and immediately dive into practice, then this 3-hour MySQL crash course is a good option.
8️⃣ freeCodeCamp Relational Database and SQL Courses
freeCodeCamp’s YouTube channel has a full-length MySQL tutorial that covers relational database and SQL fundamentals using MySQL.
Recently, they’ve also introduced the Relational Database certification that teaches you all about relational databases using PostgreSQL as the database of choice. In addition, this course also teaches you Version Control with Git and Bash Scripting which are great additions to your developer toolbox.
Along the way, you will build several projects to reinforce your learning. Here are the projects you will build as part of the certification:
- Database of Celestial Bodies Using PostgreSQL
- World Cup Database Using Bash Scripts and PostgreSQL
- Salon Appointment Scheduler
- Periodic Table Database
- Number Guessing Game
You can check out the details of the free relational database certification and start coding your way through the curriculum.
9️⃣ Codecademy Learn SQL
Codecademy offers Learn SQL, a course covering SQL fundamentals. Under the free plan you can only access the lessons; to access the quizzes and the projects, you need to have a good Codecademy PRO subscription.
Here’s how the course is laid out into sections:
- Manipulation
- Queries
- Aggregate Functions
- Multiple Tables
Cognitive Class SQL and Relational Databases 101
Cognitive class is a free e-Learning platform by IBM. You can take a variety of courses on Python programming, machine learning, and data science. Cognitive Class offers a course on relational databases and SQL. This introductory course is split into modules, each having quizzes and a comprehensive exam at the end, testing the learners on the contents of the course.
Here’s an overview of the course curriculum:
- Intro to SQL and Relational Databases
- Relational Model Constraints and Data Objects
- Data Definition Language (DDL) and Data Manipulation Language (DML)
- Advanced SQL
Useful Resources to Practice SQL
1️⃣ HackerRank
HackerRank, a popular platform for interview practice, has a dedicated section on SQL questions. You can practice by solving SQL questions on database engines of choice, such as MySQL, PostgreSQL, and more. You can filter questions by difficulty level and topics such as aggregate functions and joins.
2️⃣ StrataScratch SQL Interview Questions
StrataScratch is yet another helpful platform for interview preparation. If you’d like to practice some SQL questions that have been asked in interviews of big tech companies, then StrataScratch can be a great place to start. Although it’s a paid platform, you can access a certain number of questions for free.
3️⃣ 8-Week SQL Challenge by Data with Danny
If you are looking to level up your SQL skills, the 8-week SQL challenge by Data with Danny is one option to consider. You should work your way through the challenges and try to write SQL queries to answer the questions.
4️⃣ LeetCode
LeetCode, one of the most popular interview preparation sites, also has a section for SQL practice. You may access a subset of questions for free. LeetCode also provides sorting of questions—both by difficulty level and topics so that you can focus on topics you need to work on.
Wrapping Up
I hope you found this listicle of SQL tutorials helpful. You may go through one or more of these tutorials to gain foundational SQL skills. However, building on the foundations through deliberate practice is the key to acing SQL interviews.
You should practice enough questions of different types while honing your problem solving skills—on one of the above-listed platforms or any platform of your choice. When solving SQL questions, it’s important to understand the problem thoroughly, try to translate your thought process into words (you may use paper for this process) and then start writing your SQL queries.
Wish you the best in your data science journey. Happy learning, keep coding!✨