Data Analyst SQL Roadmap

From your first SELECT to FAANG-level analytical SQL

0/50

Beginner

0/26 exercises

Build your SQL foundations

πŸ”
B1Not Started

SELECT Fundamentals

Filter, sort, and limit rows from a single table using WHERE, IN, BETWEEN, LIKE, ORDER BY, and LIMIT.

WHEREINBETWEENLIKE+2
πŸ“Š
B2Not Started

Aggregation & GROUP BY

Summarize data with aggregate functions and group results using GROUP BY and HAVING.

COUNTSUMAVGMIN+3
πŸ”—
B3Not Started

Basic Joins

Combine rows from two tables with INNER JOIN and LEFT JOIN, and apply WHERE and GROUP BY on joined data.

INNER JOINLEFT JOINJOIN + WHEREJOIN + GROUP BY
❓
B4Not Started

NULL Handling & CASE

Handle missing data with IS NULL and COALESCE, and add conditional logic with CASE WHEN expressions.

IS NULLCOALESCECASE WHEN

Intermediate

0/19 exercises

Compose complex queries

πŸ”€
I1Not Started

Multi-table Joins

Join three or more tables, use self-joins, and apply CROSS JOIN for combinations.

3+ table JOINSelf-joinCROSS JOIN
🧩
I2Not Started

Subqueries & CTEs

Break complex queries into named steps with CTEs and use scalar, row, and correlated subqueries.

SubqueryCTECorrelated subquery
πŸ†
I3Not Started

Window Functions: Ranking

Assign rankings within groups using ROW_NUMBER, RANK, and DENSE_RANK to solve Top-N per group problems.

ROW_NUMBERRANKDENSE_RANKTop-N per group
πŸ“ˆ
I4Not Started

Window Functions: Analytics

Compare rows across time with LAG and LEAD to compute year-over-year and month-over-month growth.

LAGLEADYoY growthMoM growth
🚫
I5Not Started

Anti-joins & Set Operations

Find missing or unmatched records with anti-join patterns and combine result sets with UNION and INTERSECT.

LEFT JOIN + IS NULLNOT EXISTSUNIONINTERSECT
πŸ“…
I6Coming Soon

Date & String Functions

Manipulate dates with DATE_TRUNC, EXTRACT, and DATEDIFF, and transform strings with TRIM and SUBSTRING.

DATE_TRUNCEXTRACTDATEDIFFTRIM+1
πŸ”„
I7Coming Soon

Conditional Aggregation

Create pivot-style summaries using SUM(CASE WHEN ...) and DuckDB's FILTER clause for conditional counts and sums.

SUM(CASE WHEN)FILTER clause

Advanced

0/5 exercises

Master analytical patterns

πŸ“‰
A1Not Started

Running Totals & Moving Averages

Compute cumulative sums and sliding-window averages using window frames (ROWS BETWEEN).

Running totalMoving averageWindow frames
🏝️
A2Not Started

Gaps & Islands

Detect consecutive sequences and gaps in data using the ROW_NUMBER subtraction technique.

ROW_NUMBER subtractionGap detectionIsland detection
πŸ‘₯
A3Not Started

Cohort Retention Analysis

Assign users to cohorts, track activity over time periods, and compute retention percentages.

Cohort assignmentRetention matrixRetention %
πŸ”½
A4Not Started

Funnel Analysis

Model multi-step conversion funnels with chained CTEs to compute step-by-step conversion rates and drop-off.

Funnel stepsConversion ratesDrop-off analysis
πŸ’°
A5Coming Soon

Revenue Metrics (MRR/LTV)

Calculate monthly recurring revenue, churn rate, lifetime value, and net revenue retention from subscription data.

MRRChurn rateLTVNet revenue retention
πŸ”„
A6Coming Soon

PIVOT / UNPIVOT

Reshape data between wide and long formats using manual CASE WHEN pivots and DuckDB's native PIVOT/UNPIVOT.

Manual pivotDuckDB PIVOTUNPIVOT
πŸ¦†
A7Coming Soon

DuckDB Modern SQL

Leverage DuckDB-specific syntax like QUALIFY, GROUP BY ALL, EXCLUDE, FILTER, and ASOF JOIN for cleaner queries.

QUALIFYGROUP BY ALLEXCLUDEFILTER+1
🎯
A8Coming Soon

Advanced Business Scenarios

Tackle complex real-world analytics: A/B testing, engagement scoring, and multi-dimensional aggregation with GROUPING SETS.

A/B testingEngagement scoringGROUPING SETS