Data and AI

Learn SQL for Analytics

2 plans 13 lessons

Window functions, CTEs, advanced JOINs, query optimization, and indexing for real analytics work.

What You'll Learn

01Core

Window functions

Use ROW_NUMBER, RANK, LAG, LEAD, and running totals over partitions.

window functionsOVERpartitionranking
02Core

CTEs and recursive queries

Build readable query chains and traverse hierarchies with recursive CTEs.

CTEsWITHrecursivehierarchies
03Core

Advanced JOINs and set operations

Use CROSS JOIN, FULL OUTER, EXCEPT, and INTERSECT for complex data merges.

JOINsUNIONEXCEPTINTERSECT
04Core

Subqueries and correlated subqueries

Write efficient scalar and correlated subqueries to answer multi-step questions.

subqueriescorrelatedscalar
05Challenge

Query optimization fundamentals

Read EXPLAIN output and rewrite queries to avoid full scans.

optimizationEXPLAINquery plans
06Core

Indexing strategies

Choose between B-tree, hash, and composite indexes to speed up queries.

indexingB-treecomposite index
07Challenge

Capstone: analytics data mart

Design and query a star-schema data mart for business reporting.

capstonedata martstar schema

Query data like an analyst

7 days of joins, aggregates, CTEs, and KPI patterns — get answers from data without waiting for anyone.

Start learning

I used to ask our data team for every report. Now I write the queries myself. This plan changed my workflow.

— Kate P., growth lead

Browse all courses