Learn

SQL, one lesson at a time.

79 short lessons, each with runnable examples and a quick check. Free, in order, and saved as you go.

Start here Introduction to SELECT Basics · 0 of 79 lessons done
01

Basics

Your first queries: SELECT, WHERE, ORDER BY, NULLs and CASE.

0/19
  1. 1 Introduction to SELECT
  2. 2 Selecting Specific Columns
  3. 3 Filtering with WHERE
  4. 4 Multiple Conditions with AND/OR
  5. 5 Sorting with ORDER BY
  6. 6 Limiting Results with LIMIT
  7. 7 Range Queries with BETWEEN
  8. 8 Multiple Values with IN
  9. 9 Pattern Matching with LIKE
  10. 10 Column Aliases with AS
  11. 11 Sorting by Several Columns
  12. 12 Paging with OFFSET
  13. 13 NULL Values and IS NULL
  14. 14 Excluding Rows with NOT
  15. 15 COALESCE - Handling NULLs
  16. 16 CASE WHEN - Conditional Logic
  17. 17 Type Casting with CAST
  18. 18 Math Functions
  19. 19 Working with Dates
02

Intermediate

Combine tables and summarize data with JOINs and GROUP BY.

0/20
  1. 1 Counting with COUNT
  2. 2 SUM and AVG
  3. 3 MIN and MAX
  4. 4 Grouping with GROUP BY
  5. 5 Filtering Groups with HAVING
  6. 6 Unique Values with DISTINCT
  7. 7 Introduction to Subqueries
  8. 8 Subqueries with IN
  9. 9 Subqueries in FROM
  10. 10 Combining Tables with INNER JOIN
  11. 11 LEFT JOIN - Keep All Left Rows
  12. 12 Finding Rows Without a Match
  13. 13 Joining Three or More Tables
  14. 14 UNION and UNION ALL
  15. 15 INTERSECT and EXCEPT
  16. 16 String Functions
  17. 17 Grouping by Dates
  18. 18 Conditional Aggregation
  19. 19 Finding Duplicates
  20. 20 The Order SQL Runs In
03

Advanced

Window functions, CTEs, recursion and the patterns interviews love.

0/18
  1. 1 Introduction to Window Functions
  2. 2 RANK and DENSE_RANK
  3. 3 PARTITION BY
  4. 4 LAG and LEAD
  5. 5 Introduction to CTEs
  6. 6 CTEs with Window Functions
  7. 7 Self Joins
  8. 8 Recursive CTEs
  9. 9 Query Optimization Basics
  10. 10 NTILE - Dividing into Buckets
  11. 11 Aggregate Window Functions
  12. 12 Running Totals and Moving Averages
  13. 13 Percent of Total
  14. 14 Growth Rates with LAG
  15. 15 EXISTS and NOT EXISTS
  16. 16 Correlated Subqueries
  17. 17 Finding the Median
  18. 18 Gaps and Islands: Finding Streaks
04

Extras

How SQL is used on the job: roles, tools, dialects and habits.

0/22
  1. 1 SQL Terminology
  2. 2 Views - Virtual Tables
  3. 3 Indexes - Speed Up Queries
  4. 4 Snowflake - Cloud Data Warehouse
  5. 5 dbt - Transform Data with SQL
  6. 6 Databricks - Unified Analytics
  7. 7 Transactions & ACID
  8. 8 Databases vs Data Warehouses
  9. 9 Career: Data Analyst
  10. 10 Career: Analytics Engineer
  11. 11 Career: Data Engineer
  12. 12 Career: Business Analyst
  13. 13 SQL Dialects: Overview
  14. 14 PostgreSQL vs MySQL
  15. 15 SQLite: The Embedded Database
  16. 16 Cloud SQL: BigQuery, Redshift, Snowflake
  17. 17 SQL is Everywhere
  18. 18 SQL Interview Tips
  19. 19 Building a SQL Portfolio
  20. 20 SQL Salary Guide 2026
  21. 21 SQL in AI and Machine Learning
  22. 22 Real-World SQL - Day in the Life