Learn SQL
Structured lessons from the basics up — follow the path below in order, at your own pace.
-
1
Level 1 — Beginner Beginner 27 lessons
Start here if you have never written a query before. No programming experience is required — work through these lessons in order, since each...
Lessons in this module
What Is SQL? Why Learn SQL? What Can You Do With SQL? Relational Databases: Tables, Rows, and Keys Setting Up: Your First Database Our Sample Database Your First Query: SELECT Choosing Columns, Aliases, and Calculations DISTINCT: Unique Values Filtering Rows with WHERE Combining Conditions: AND, OR, NOT IN, BETWEEN, and LIKE NULL: Missing Values Sorting with ORDER BY Limiting Results and Pagination Data Types Text Functions Numbers and Arithmetic Dates and Times Aggregate Functions Grouping with GROUP BY Filtering Groups with HAVING Creating Tables Inserting Data Updating and Deleting Data How a Query Is Processed Comments and SQL Style -
2
Beginner Projects Beginner 1 lesson
Practice with the sample database from the "Our Sample Database" lesson, or build your own. Each project is a set of questions to answer wit...
-
3
Level 2 — Intermediate Intermediate 18 lessons
These lessons cover joins, subqueries, common table expressions, CASE, set operations, constraints and keys, database design and normalizati...
Lessons in this module
Joining Tables: INNER JOIN Table Aliases and Multi-Table Joins LEFT JOIN: Keeping Unmatched Rows RIGHT JOIN, FULL OUTER JOIN, and CROSS JOIN Self-Joins Subqueries Correlated Subqueries and EXISTS Common Table Expressions (WITH) CASE Expressions Set Operations: UNION, INTERSECT, EXCEPT Constraints and Foreign Keys Designing Tables and Relationships Normalization Views Upserts: Insert or Update Using SQL from Application Code Importing and Exporting Data SQL Dialects: PostgreSQL, MySQL, SQL Server, SQLite -
4
Intermediate Projects Intermediate 1 lesson
Build these using joins, subqueries, CTEs, CASE, constraints, and database design from Level 2. 1. Sales Analysis Using the sample database,...
-
5
Level 3 — Advanced Advanced 16 lessons
These lessons cover window functions, recursive queries, indexes and query plans, transactions and isolation, concurrency and locking, JSON...
Lessons in this module
Window Functions: Ranking Window Functions: Running Totals and Moving Averages Window Functions: LAG, LEAD, and NTILE Recursive Queries Indexes Reading Query Plans with EXPLAIN Query Optimization Techniques Transactions Isolation Levels and Concurrency JSON in SQL Full-Text Search Triggers, Stored Procedures, and Functions Database Security Schema Migrations Analytical SQL Patterns Databases in Production -
6
Advanced Projects Advanced 1 lesson
Build these using window functions, recursive queries, indexing, transactions, and the production practices from Level 3. 1. Analytics Dashb...
-
7
What You Should Know Now — and What's Next 1 lesson
What You Should Know Now How relational databases organize data into tables, rows, and columns Querying with SELECT , filtering with WHERE ,...