unnested
Pro

© 2026 unnested

Built for learners, by learners

AboutPrivacy PolicyTerms of ServiceContactSuggest a feature

SQL Roadmap

Start with your first SELECT and work up through joins, aggregation, window functions, CTEs, and query internals. Each step is a reference guide followed by practice problems - read it, prove it, move on. 33 reference guides across three tiers, 152+ problems total.
Sign in to track your progress
BeginnerThe foundations every SQL query is built on. Start here.

How a Database Thinks

What a relational database actually is and why it works the way it does.

SELECT Basics

The anatomy of a SELECT statement and how to start reading data.

1 problems
SELECT Basics

Filtering

How to ask for only the rows you actually want.

6 problems
Filtering

NULL

Why NULL is not zero, not empty string, and why it breaks the rules you expect.

2 problems
NULL

Sorting

ORDER BY, LIMIT, and OFFSET: controlling the shape of your result set.

8 problems
Sorting

Aggregation

Collapsing many rows into a single summary value.

8 problems
Aggregation

Grouping

Summarizing data by category, and filtering those summaries.

14 problems
Grouping

Filtering Groups

How to filter aggregated results using HAVING.

8 problems
Filtering Groups

Joins

How to pull related data from multiple tables into a single result.

11 problems
Joins

Subqueries

Queries inside queries: how to use one result as input for another.

6 problems
Subqueries

String Functions

The most useful built-in functions for working with text and time.

8 problems
String Functions

Date Functions

How to extract, truncate, and calculate with dates and timestamps.

7 problems
Date Functions

Date Filtering

How to filter rows by date ranges and relative time windows.

3 problems
Date Filtering

Distinct

How to eliminate duplicate rows from query results.

8 problems
Distinct
IntermediateWindow functions, CTEs, indexes, and how SQL actually executes.

Window Functions

Aggregations that keep the original rows: ranking, running totals, and more.

26 problems
Window Functions

CTEs

Named temporary result sets that make complex queries readable.

11 problems
CTEs

CASE Expressions

Conditional logic inside your SQL: branching without a programming language.

8 problems
CASE Expressions

Set Operations

Combining the results of multiple queries as if they were sets.

8 problems
Set Operations

Self Joins

Joining a table to itself to find relationships within the same dataset.

8 problems
Self Joins

Indexes: How Databases Find Data Fast

What indexes are, when they help, and when they do not.

Query Planning and EXPLAIN

How the database decides to run your query, and how to read the plan.

Data Types and Casting

The types that matter most and how to convert between them.

Views

Saved queries that behave like tables: when to use them and when not to.

Constraints and Data Integrity

The rules you teach the database so it can protect your data.

Logical Query Processing Order

The order SQL evaluates your query, which matters more than you think.

AdvancedRecursive queries, transactions, isolation levels, and performance.

Recursive CTEs

Traversing hierarchies and graphs in pure SQL.

1 problems
Recursive CTEs

Lateral Joins

Subqueries that can see the current row: the tool for top-N per group.

JSON in SQL

Storing and querying semi-structured data with PostgreSQL's JSONB.

Transactions: All or Nothing

How databases guarantee that related changes succeed or fail together.

Isolation Levels

The tradeoff between concurrency and correctness in multi-user databases.

Partitioning

Splitting large tables into smaller pieces for better query performance and data management.

Stored Procedures and Functions

Encapsulating logic in the database: when it makes sense and when it does not.

Performance Tuning

A systematic approach to finding and fixing slow queries.

Practice Problems →

Browse all SQL problems by topic or difficulty

Browse Reference Guides →

All 33 reference guides, organized by tier