SQL Topics

Master SQL through topic-driven practice

Choose one SQL concept, practice it through a deliberate progression, and run every answer against realistic data. SQL Topics contains 219 free exercises across 15 focused collections.

Learn and master one SQL capability at a time.

Choose a SQL topic

219 interactive problems

SELECT Statements

23 problems

Select columns, filter rows, remove duplicates, and order query results.

BeginnerOpen SELECT Statements topic →

WHERE Clause & Filtering

12 problems

Practice SQL WHERE clauses with realistic boundary, NULL, text, date, exclusion, and production-filtering problems.

Beginner to AdvancedOpen WHERE Clause & Filtering topic →

LIMIT & OFFSET

7 problems

Practice deterministic top-N, cutoff ties, offset pagination, composite keyset cursors, and resumable bounded batches.

Beginner to AdvancedOpen LIMIT & OFFSET topic →

Basic SQL Functions

13 problems

Practice production-oriented string cleanup, numeric transformations, NULL handling, tolerant conversion, and delimiter parsing.

Beginner to AdvancedOpen Basic SQL Functions topic →

ORDER BY & Sorting

15 problems

Practice deterministic SQL ordering with tie-breakers, custom priorities, NULL placement, expressions, joined data, aggregates, and portable top-N patterns.

Beginner to AdvancedOpen ORDER BY & Sorting topic →

SQL Joins

16 problems

Practice reliable INNER, LEFT, FULL, CROSS, self, semi, anti, range, temporal, and many-to-many join patterns.

Beginner to AdvancedOpen SQL Joins topic →

SQL Subqueries

12 problems

Practice scalar, derived-table, correlated, EXISTS, NULL-safe anti-subquery, quantified, and row-subquery patterns.

Beginner to AdvancedOpen SQL Subqueries topic →

CTEs & Window Functions

11 problems

Practice modular CTE pipelines, deterministic window analytics, period comparisons, deduplication, frames, and gaps-and-islands.

Beginner to AdvancedOpen CTEs & Window Functions topic →

SQL Aggregations

16 problems

Build reliable SQL metrics from aggregate functions through grain, fan-out, weighted ratios, rollups, percentiles, and approximate counts.

Beginner to AdvancedOpen SQL Aggregations topic →

Ranking & NTH Value

17 problems

Solve deterministic ranking, top-N, distribution, positional-frame, and rolling-window problems.

Intermediate to AdvancedOpen Ranking & NTH Value topic →

Finding Duplicates & Data Quality

12 problems

Detect identity collisions, profile NULL-aware conflicts, and compare deterministic survivors with production-safe SQL.

Beginner to AdvancedOpen Finding Duplicates & Data Quality topic →

CASE Statements & Conditional Logic

13 problems

Build NULL-aware classifications, precedence-safe decisions, flags, scores, and guarded calculations with portable CASE expressions.

Beginner to AdvancedOpen CASE Statements & Conditional Logic topic →

Database Changes

10 problems

Practice safe SQL data changes, schema evolution, retry-safe upserts, transactions, rollback, views, and indexes in isolated databases.

Beginner to HardOpen Database Changes topic →

Date Operations & Time-Based Analytics

26 problems

Practice date arithmetic, safe timestamp ranges, calendar bucketing, dense time series, rolling windows, growth, and cohort analysis.

Easy to HardOpen Date Operations & Time-Based Analytics topic →

Self Joins & Hierarchical Queries

16 problems

Query organization charts, trees, and parent-child relationships.

AdvancedOpen Self Joins & Hierarchical Queries topic →