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