Skip to main content
Back to courses

SQL for Analysis

Go beyond the basics with subqueries, CTEs, window functions and the analytics patterns analysts use every day, practised in your browser.

Level: Intermediate4 modules · 12 lessons · 7h 18m
sqldata analysiswindow functionsctesubqueriesanalyticssqlite

Leads to: Data Analyst, Data Scientist, Systems Analyst, Database Administrator, Back-End Developer, Data Engineer

Before you start

This course builds on SQL Fundamentals. Take it first if you are new to the topic.

About this course

This intermediate course takes you from writing single SELECT statements to answering real business questions in SQL, the way data analysts, data scientists, systems analysts and database administrators do at work. It builds on SQL Fundamentals and uses SQLite in your browser, so there is nothing to install. The first module covers advanced queries: subqueries (including correlated subqueries and EXISTS), common table expressions that turn nested queries into readable steps, and set operations such as UNION ALL and EXCEPT. The second module teaches window functions: ranking rows within groups with ROW_NUMBER, RANK and DENSE_RANK, running totals and moving averages with window frames, and period-over-period change with LAG and LEAD. The third module applies these tools to the analytics patterns employers ask about most: cohort retention tables, conversion funnels and data quality checks. The last module is about SQL other people can trust: a practical style guide, how indexes and query plans affect speed, and a capstone that answers a business question end to end and communicates the result. Every lesson except one ends with a query you write and check against realistic data, and lessons point out where PostgreSQL, MySQL, SQL Server and cloud warehouses differ.

Course content

  1. Module 1

    Advanced Queries

  2. Module 2

    Window Functions

  3. Module 3

    Analytics Patterns

  4. Module 4

    Readable and Fast SQL

Where this course leads

Next course on the path