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

Lock contention is one of the most damaging and misunderstood performance problems in production databases. This expert-level lesson walks you through the complete diagnostic and resolution workflow — from tracing blocking chains with recursive CTEs and system views, to reading execution plans for lock behavior, to choosing the right isolation level and implementing fixes that actually stick.

Most SQL errors in grouped queries come from filtering at the wrong stage. This lesson teaches you exactly when to use WHERE versus HAVING — and what goes wrong when you mix them up.

Window functions like LAG and LEAD stop at partition boundaries by design — but your business logic often doesn't. This lesson teaches five concrete SQL techniques for reaching across partition boundaries, with realistic e-commerce examples and performance guidance for each approach.

Sequence gaps — missing IDs, uncovered date ranges, holes in attendance records — hide data quality problems that standard queries never surface. This expert-level lesson teaches you every production-ready technique for finding and filling them, from self-joins to window functions, with full performance analysis.

Slow queries are frustrating — but the database is already telling you exactly what's wrong. Learn to read SQL execution plans from scratch: understand EXPLAIN output, decode scan types like Seq Scan and Index Scan, and spot performance problems before they hit production.

Learn how to compare two time periods — month-over-month, quarter-over-quarter — in a single SQL query using derived tables, FULL OUTER JOIN, and CASE-based percentage change logic. Includes CTEs, conditional aggregation alternatives, and a hands-on exercise with realistic data.

Slowly Changing Dimensions are where data warehouse pipelines either earn trust or quietly corrupt history. This lesson teaches you production-grade SQL for Type 1 overwrites, Type 2 versioned history, and the hybrid Type 6 pattern — using MERGE, CTEs, and window functions to handle late-arriving data, phantom changes, and scale.

SQL doesn't sort or trim your results unless you tell it to. Learn how ORDER BY, LIMIT, OFFSET, and TOP give you precise control over what your queries return — and in what order — across MySQL, PostgreSQL, and SQL Server.

Window functions are powerful but can destroy query performance at scale. Learn how to design partition strategies, choose the right frame boundaries, and align indexes to eliminate sort spills and cut execution times by orders of magnitude.

Data gaps are invisible by default — SQL only shows you what exists, not what's missing. This lesson teaches you how to systematically detect missing records across related tables using LEFT JOIN anti-joins, NOT EXISTS correlated subqueries, generated date spines, and FULL OUTER JOIN reconciliation patterns, with production-quality examples and performance guidance throughout.

Stop guessing why your SQL queries are slow. Learn to read EXPLAIN and EXPLAIN ANALYZE output to diagnose performance problems, identify expensive operations, and apply targeted fixes that actually work.

Duplicate records silently corrupt every report and join that touches them — often without raising an error. Learn how to detect exact and partial duplicates with GROUP BY and HAVING, then safely remove them using ROW_NUMBER() subquery patterns you can trust with production data.