Start learning SQL
Jump in to our fun, free and engaging SQL course and become a skilled data analyst faster than you can say "left join".
Browse course content
Start from scratch with the introductory lesson, or jump to the skill you want to develop by picking the lesson you want.
Introduction: Analyzing Data with SQL
In this introductory lesson, learn what SQL is, what you can do with it, and how you can start honing your skills.
Connecting data, tables, and creating a model
The first step in getting going with SQL is connecting your data and tables and learning the architecture for building your first model.
SELECTing your first data with SQL
The most basic SQL query grabs data from a table, and consists of a SELECT statement and a FROM statement.
Introduction to filtering (WHERE)
The ‘where’ clause in SQL is a very simple way to filter out rows in your data set based on the content of it.
Using !, =, <, > to filter data in SQL
You can use symbols like !, =, <, and > to filter data in SQL. Learn the basics of how each symbol works.
AND / OR: Filtering your data with several conditions
Learn how to combine several conditions in your ‘where’ statement by using the statements ‘and’ & ‘or’.
Filtering on non-exact values with LIKE
In cases where you're unable to define the conditions exactly, you can use 'like' clause to filter on values that match more or less.
Filtering when conditions are NOT fulfilled
To filter out based on values that are not exact, you can use the 'not' statement.
Introduction to columns
In this section of the tutorial, you’ll work with something new: creating new content to be included in your table.
Creating a new column and naming it AS something
Apart from selecting columns from the existing data, it’s also very simple to create new columns, and name them using 'as'.
Making calculations in columns
Creating your own columns in SQL becomes even more useful for business analysis when you include calculations in the columns.
Using CASE WHEN as IF statements in SQL
In SQL the ‘case’ statement functions the same way as the 'if' function in Excel.
Introduction to data aggregation
This lesson introduces data aggregation. More specifically, you'll learn what to expect in this chapter and how to aggregate data.
Using COUNT, SUM, AVG, MIN, and MAX
COUNT, SUM, AVG, MIN, and MAX are the SQL functions you'll use most for aggregating data.
GROUP BY and ORDER BY
GROUP BY and ORDER BY help you summarize the results on a level in between looking at all the rows in a table and only looking at one.
Avoid failing queries with aggregate functions and GROUP BY
Learn to avoid the common causes of fails when using aggregate functions and GROUP BY.
Introduction to sub-queries and CTE
Sub-queries and CTEs are ways to create temporary tables than can then be treated in a separate step in your query.
SQL WITH
The SQL WITH clause is a CTE that allows you to create a temporary table which you can then treat in a separate step in your query.
Introduction to JOIN
Introduction to the JOIN function. Learn how to increase the width of the resulting table by adding columns from other tables.
Finding Common Identifiers & Choosing your Primary Table
Joining tables in SQL requires you to have a common identifier between tables A & B. Learn how to find it.
Using the JOIN function to combine tables
Joining tables is a way to get data from multiple tables in your SQL query. This is great if you want to query data on separate tables.
Combining CTEs with JOIN
Combining CTEs with JOINs allows you to have an even greater level of data to analyze, without unnecessarily overloading your query.
What’s next? Start analyzing your own business data
Congratulations! You've made it through our SQL tutorial. The next step is to start analyzing your own business data.
The order of the elements in your query
In order for your SQL query to return any results, your functions should follow a specific order. Learn what that order is in this lesson.
LIMITing the amount of data with SQL
Limiting the amount of rows your SQL query returns is a nifty way to see an excerpt of your query's results (or to see if it has no errors).
Formatting best practices
Learn the various different ways you can format your SQL code to improve readability and understandability.
Documenting your code
Documenting your code ensures that you and others can go back and understand what the code is doing and how it’s structured.