Welcome to the SQL Tutorial

Learn to answer questions with data using SQL. No coding experience necessary.

lesson-icon

Basic SQL

Lesson 1

The SQL Tutorial for Data Analysis

Learn to answer questions with data to solve challenging problems.

Start Now

Lesson 2

Using SQL in Mode

Learn to use Mode's Query Editor to run SQL queries against data in a relational database.

Start Now

Lesson 3

SQL SELECT

The SQL SELECT statement is used to retrieve data from a database based on criteria specified in the query.

Start Now

Lesson 4

SQL LIMIT

Use the SQL LIMIT command to restrict how many rows a SQL query returns.

Start Now

Lesson 5

SQL WHERE

Use the SQL WHERE clause to filter data.

Start Now

Lesson 6

SQL Comparison Operators

Use SQL comparison operators like =, <, and, > to filter numerical and non-numerical data.

Start Now

Lesson 7

SQL Logical Operators

SQL logical operators allow you to filter results using several conditions at once.

Start Now

Lesson 8

SQL LIKE

An introduction to the LIKE operator, which matches similar values.

Start Now

Lesson 9

SQL IN

Use the SQL IN operator in the WHERE clause to filter data by a list of values.

Start Now

Lesson 10

SQL BETWEEN

Use the SQL BETWEEN operator to select values from a specific range.

Start Now

Lesson 11

SQL IS NULL

Use SQL's IS NULL operator to select rows that have no data in a given column.

Start Now

Lesson 12

SQL AND

Use the SQL AND operator to select rows that satisfy two or more conditions.

Start Now

Lesson 13

SQL OR

Use the SQL OR operator to select rows that satisfy either of two conditions.

Start Now

Lesson 14

SQL NOT

Use the SQL NOT operator to select rows for which a certain conditional statement is false.

Start Now

Lesson 15

SQL ORDER BY

See code and examples of using SQL ORDER BY to sort data.

Start Now

Intermediate SQL

Lesson 1

SQL Aggregate Functions

Aggregate data across entire columns using the COUNT, SUM, MIN, MAX, and AVG functions.

Start Now

Lesson 2

SQL COUNT

Using SQL COUNT to count the number of rows in a particular column.

Start Now

Lesson 3

SQL SUM

Use the SQL SUM function to total the numerical values in a particular column.

Start Now

Lesson 4

SQL MIN/MAX

See examples using the SQL MIN and MAX functions to select the highest and lowest values in a particular column.

Start Now

Lesson 5

SQL AVG

Using the SQL AVG function to select the average of a selected group of values.

Start Now

Lesson 6

SQL GROUP BY

Use the GROUP BY clause to separate data into groups

Start Now

Lesson 7

SQL HAVING

Use the SQL HAVING clause to filter an aggregated query.

Start Now

Lesson 8

SQL DISTINCT

Using SQL DISTINCT to view and aggregate unique values in a given column.

Start Now

Lesson 9

SQL CASE

Using if/then logic with the SQL CASE statement.

Start Now

Lesson 10

SQL Joins

An introduction to SQL joins and the relational logic behind them.

Start Now

Lesson 11

SQL INNER JOIN

Use a SQL INNER JOIN to select rows that satisfy a join statement and eliminate rows that don't.

Start Now

Lesson 12

SQL Outer Joins

This lesson of the SQL tutorial for data analysis introduces the concept of outer joins.

Start Now

Lesson 13

SQL LEFT JOIN

See code and examples for LEFT JOIN.

Start Now

Lesson 14

SQL RIGHT JOIN

See code and examples for RIGHT JOIN.

Start Now

Lesson 15

SQL Joins Using WHERE or ON

Learn the differences between filtering joined data using WHERE or ON

Start Now

Lesson 16

SQL FULL OUTER JOIN

Learn about SQL FULL OUTER JOIN, which returns unmatched rows from both tables being joined.

Start Now

Lesson 17

SQL UNION

UNION allows you to stack one dataset on top of another dataset.

Start Now

Lesson 18

SQL Joins with Comparison Operators

Use comparison operators with SQL joins, which is especially helpful for defining date ranges.

Start Now

Lesson 19

SQL Joins on Multiple Keys

Learn to join tables on multiple keys to boost performance and make SQL queries run faster.

Start Now

Lesson 20

SQL Self Joins

Learn the situations where you might want to join a table to itself, and how to do so.

Start Now

Get started