Welcome to the SQL Tutorial
Learn to answer questions with data using SQL. No coding experience necessary.
Basic SQL
Introduction
The SQL Tutorial for Data Analysis
Learn to answer questions with data to solve challenging problems.
Start NowLesson 1
Using SQL in Mode
Learn to use Mode's Query Editor to run SQL queries against data in a relational database.
Start NowLesson 2
SQL SELECT
The SQL SELECT statement is used to retrieve data from a database based on criteria specified in the query.
Start NowLesson 3
SQL LIMIT
Use the SQL LIMIT command to restrict how many rows a SQL query returns.
Start NowLesson 4
SQL WHERE
Use the SQL WHERE clause to filter data.
Start NowLesson 5
SQL Comparison Operators
Use SQL comparison operators like =, <, and, > to filter numerical and non-numerical data.
Start NowLesson 6
SQL Logical Operators
SQL logical operators allow you to filter results using several conditions at once.
Start NowLesson 7
SQL LIKE
An introduction to the LIKE operator, which matches similar values.
Start NowLesson 8
SQL IN
Use the SQL IN operator in the WHERE clause to filter data by a list of values.
Start NowLesson 9
SQL BETWEEN
Use the SQL BETWEEN operator to select values from a specific range.
Start NowLesson 10
SQL IS NULL
Use SQL's IS NULL operator to select rows that have no data in a given column.
Start NowLesson 11
SQL AND
Use the SQL AND operator to select rows that satisfy two or more conditions.
Start NowLesson 12
SQL OR
Use the SQL OR operator to select rows that satisfy either of two conditions.
Start NowLesson 13
SQL NOT
Use the SQL NOT operator to select rows for which a certain conditional statement is false.
Start NowLesson 14
SQL ORDER BY
See code and examples of using SQL ORDER BY to sort data.
Start NowIntermediate SQL
Introduction
Putting it together
Aggregate data and join tables for more meaningful analysis across broader data sets.
Start NowLesson 1
SQL Aggregate Functions
Aggregate data across entire columns using the COUNT, SUM, MIN, MAX, and AVG functions.
Start NowLesson 2
SQL COUNT
Using SQL COUNT to count the number of rows in a particular column.
Start NowLesson 3
SQL SUM
Use the SQL SUM function to total the numerical values in a particular column.
Start NowLesson 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 NowLesson 5
SQL AVG
Using the SQL AVG function to select the average of a selected group of values.
Start NowLesson 6
SQL GROUP BY
Use the GROUP BY clause to separate data into groups
Start NowLesson 7
SQL HAVING
Use the SQL HAVING clause to filter an aggregated query.
Start NowLesson 8
SQL CASE
Using if/then logic with the SQL CASE statement.
Start NowLesson 9
SQL DISTINCT
Using SQL DISTINCT to view and aggregate unique values in a given column.
Start NowLesson 10
SQL Joins
An introduction to SQL joins and the relational logic behind them.
Start NowLesson 11
SQL INNER JOIN
Use a SQL INNER JOIN to select rows that satisfy a join statement and eliminate rows that don't.
Start NowLesson 12
SQL Outer Joins
This lesson of the SQL tutorial for data analysis introduces the concept of outer joins.
Start NowLesson 13
SQL LEFT JOIN
See code and examples for LEFT JOIN.
Start NowLesson 14
SQL RIGHT JOIN
See code and examples for RIGHT JOIN.
Start NowLesson 15
SQL Joins Using WHERE or ON
Learn the differences between filtering joined data using WHERE or ON
Start NowLesson 16
SQL FULL OUTER JOIN
Learn about SQL FULL OUTER JOIN, which returns unmatched rows from both tables being joined.
Start NowLesson 17
SQL UNION
UNION allows you to stack one dataset on top of another dataset.
Start NowLesson 18
SQL Joins with Comparison Operators
Use comparison operators with SQL joins, which is especially helpful for defining date ranges.
Start NowLesson 19
SQL Joins on Multiple Keys
Learn to join tables on multiple keys to boost performance and make SQL queries run faster.
Start NowLesson 20
SQL Self Joins
Learn the situations where you might want to join a table to itself, and how to do so.
Start NowAdvanced SQL
Introduction
Leveling up
Learn advanced SQL to take your analysis to the next level
Start NowLesson 1
SQL Data Types
Learn about SQL data types and how to change a column's data type using CONVERT and CAST.
Start NowLesson 2
SQL Date Format
Learn how dates and times are formatted in SQL, and best practices for interacting with them.
Start NowLesson 3
Data Wrangling with SQL
Programmatically transform data into a format that makes it easier to work with.
Start NowLesson 4
Using SQL String Functions to Clean Data
Use SQL string functions to clean data strings and fix date formats.
Start NowLesson 5
Writing Subqueries in SQL
Use subqueries in SQL with aggregate functions, conditional logic, and joins.
Start NowLesson 6
SQL Window Functions
Learn about SQL windowing functions such as ROW_NUMBER(), NTILE, LAG, and LEAD.
Start NowLesson 7
Performance Tuning SQL Queries
Learn how to conduct SQL performance tuning by reducing table size, simplifying joins, and the EXPLAIN command.
Start NowLesson 8
Pivoting Data in SQL
Learn to pivot rows to columns and columns to rows in SQL.
Start NowSQL Analytics Training
Introduction
About Analytics Training
Hone your analytical skills by solving real-world cases from analytics teams at data-driven companies.
Start NowLesson 1
Investigating a Drop in User Engagement
Investigating a drop in user engagement with your product.
Start NowLesson 2
Investigating a Drop in User Engagement: Answers
The answer to the problem of investigating a drop in user engagement with your product.
Start NowLesson 3
Understanding Search Functionality
How to understand in-product search functionality.
Start NowLesson 4
Understanding Search Functionality: Answers
Answers how to understand in-product search functionality and if it's worth investing in.
Start NowLesson 5
Validating A/B Test Results
How to validate A/B testing results.
Start NowLesson 6
Validating A/B Test Results: Answers
Answers how to validate A/B testing results.
Start NowLesson 7
SQL Tutorial Conclusion
You're more than ready to apply your skills to real analytical problems. On to the next step.
Start Now