LEARN · SQL
Learn SQL, one query at a time.
SELECT, WHERE, sorting, joins, window functions, and database design, explained with real queries and example tables you can run yourself. New lessons roll out one at a time.

1. SQL Basics
2. Operators and Filtering
3. Aggregate Functions
4. Joins
5. Combining and Grouping
6. Subqueries and Advanced SELECT
7. Database and Tables
8. Constraints
9. Data Types
10. Dates, Views, and Security
11. Window Functions
12. Common Table Expressions
13. Indexes and Performance
14. Transactions and ACID
15. Advanced Aggregate Functions
01SQL String Aggregation (STRING_AGG / GROUP_CONCAT)LIVE02SQL ARRAY_AGG()LIVE03SQL JSON_ARRAYAGG()LIVE04SQL JSON_OBJECTAGG()LIVE05SQL Variance (VAR_POP / VAR_SAMP)LIVE06SQL Standard Deviation (STDDEV_POP / STDDEV_SAMP)LIVE07SQL MEDIAN()LIVE08SQL MODE()LIVE09SQL PERCENTILE_CONT() and PERCENTILE_DISC()LIVE10SQL Bitwise Aggregates (BIT_AND / BIT_OR / BIT_XOR)LIVE11SQL Boolean Aggregates (BOOL_AND / BOOL_OR / EVERY)LIVE12SQL APPROX_COUNT_DISTINCT()LIVE13SQL CHECKSUM_AGG()LIVE14SQL BITMAP_CONSTRUCT_AGG()LIVE
Practice What You've Learned
150 questions across three levels, each with a real solution.
BASIC50 SQL Practice QuestionsSELECT basics through joins, subqueries, and constraints, against one fixed sample dataset.MEDIUM50 Medium SQL QuestionsCorrelated subqueries, CTEs, window functions, and real-world data cleaning.ADVANCED50 Advanced Interview QuestionsRecursive CTEs, concurrency, and system design, PostgreSQL 15+.