Intermediate · Free · In your browser
Learn SQL Intermediate
Go beyond the basics with a realistic shop database. Master LEFT and self-joins without double counting, conditional and time-based aggregation, running totals, LAG and moving averages, recursive queries, JSON columns, upserts and data updates, views and indexes, and build the query behind a monthly sales dashboard.
No installation. Your code runs right in the browser. Finish SQL Foundations first, or be comfortable with SELECT, WHERE, GROUP BY, and JOIN.
What you will be able to do
- Join tables correctly, including unmatched rows and self-references
- Build business reports with conditional aggregates, dates, and window functions
- Query hierarchies, generated series, and JSON data
- Change data safely and make queries fast with views and indexes
Course outline
Joins beyond the basics
LEFT joins, self-joins, multi-table joins, and avoiding double counting.
Aggregation that answers real questions
Conditional counts, monthly reports, shares of the total, and text lists.
Window functions in depth
Running totals, LAG and LEAD, moving averages, and a customer value report.
Hierarchies, series and JSON
Recursive queries, complete timelines, and JSON columns.
Change data safely
Upserts, updates from other tables, and views.
Performance and the capstone
Indexes and query plans, and a monthly sales dashboard.
Ready for your first line?
Every lesson is short, hands-on, and checked automatically.
Start learning SQL Intermediate →