70 in-depth articles — from Excel foundations to production machine learning. Filter by topic or difficulty to find exactly what you need.

Self-joins are one of SQL's most versatile — and most misunderstood — patterns. Learn how to query a table against itself to navigate hierarchies, compare rows, detect duplicates, and find sequential relationships, with realistic examples and clear guidance on when to use this technique versus window functions.

Duplicate rows in SQL results are one of the most common — and most fixable — problems in data work. This lesson teaches you exactly how DISTINCT, GROUP BY, and COUNT work, when to use each, and how to audit your data for duplicates like a pro.

Most complex analytical questions can't be answered in a single flat query — they require computing something, and then computing something on top of that. This lesson teaches you how to structure multi-step SQL using derived tables and inline views, with realistic examples, optimizer internals, and a complete hands-on exercise.

Learn how to write production-quality SQL that combines GROUP BY, HAVING, and CASE WHEN in a single query. This lesson goes beyond the basics to cover conditional counts, rate calculations, performance tier classification, and the subtle bugs that cause silently wrong results.

Learn how to write SQL subqueries that dynamically filter rows, look up calculated values, and check for related data — all inside a single query. This hands-on lesson builds from scalar subqueries to correlated subqueries with realistic examples and exercises.

Learn how to combine JOIN and GROUP BY to aggregate data across multiple related tables in a single SQL query. This expert-level lesson covers fan-out inflation, LEFT JOIN with aggregation, conditional aggregation, ROLLUP, and performance strategies for production-scale data.

CASE expressions let you embed if-then-else logic directly inside SQL queries — not just in SELECT, but in WHERE filters, GROUP BY buckets, and aggregate functions. This lesson teaches every form with production-realistic examples so you can write smarter queries without touching application code.

Learn how to use SQL's most essential aggregate functions — COUNT, SUM, and AVG — combined with GROUP BY to transform raw data into meaningful summaries. This hands-on lesson walks you from first principles to writing real analytical queries with confidence.

Most SQL practitioners write queries without understanding how columnar engines physically store and process data — and pay for it in two-minute queries that should take eight seconds. This lesson teaches you the internals of columnar storage, vectorized execution, and zone map pruning so you can write SQL that works with these mechanics rather than against them.

PostGIS turns PostgreSQL into a full-featured spatial database. Learn how to store, index, filter, measure, and join location data using geometry types, spatial predicates, and real-world radius and polygon queries — with production-grade performance patterns included.

Mastering subquery patterns is the inflection point between writing SQL that works and SQL that scales. This lesson teaches you when to use derived tables, scalar subqueries, and EXISTS filters — with real examples and the performance reasoning behind each choice.

Most SQL developers treat functions as black boxes — but the database treats them as contracts. Learn how PostgreSQL's IMMUTABLE, STABLE, and VOLATILE classifications shape query planning, index eligibility, and caching behavior, and how getting this wrong silently destroys performance or corrupts results.