Explore in-depth tutorials and guides across data analytics, automation, and AI. Filter by topic or difficulty to find exactly what you need.

Standard SQL joins can't reference the current outer row inside a subquery — lateral joins and CROSS APPLY break that limitation wide open. Learn how they work, when to use them, and how to write them for real-world data transformation problems across PostgreSQL, SQL Server, MySQL, and BigQuery.

Aggregation is how you turn millions of raw rows into the summaries that actually drive decisions. This lesson teaches you how GROUP BY, HAVING, ROLLUP, and CUBE work from first principles — so you can write correct, efficient aggregation queries on any database.

Most SQL practitioners use ROWS out of habit without realizing that RANGE and GROUPS exist, or that the wrong choice can silently corrupt rolling aggregates. This expert lesson dives into the mechanics, edge cases, and performance implications of all three window frame modes so you can choose — and defend — the right one every time.

Static SQL can't handle optional filters, variable column lists, or runtime table selection — dynamic SQL can. This deep-dive lesson teaches you to write parameterized dynamic SQL that's safe, performant, and production-ready, covering sp_executesql, injection prevention, optional filter procedures, and dynamic pivots.

Learn how to use CASE WHEN inside aggregate functions to create pivot-style reports, segment metrics, and answer multi-part business questions in a single SQL query — no spreadsheet exports required. This lesson builds the technique from first principles with realistic, hands-on examples.

SQL set operations are the most underutilized tool in the data professional's toolkit. This expert-level lesson teaches you the relational algebra foundations, performance internals, and production-ready patterns for using UNION, INTERSECT, and EXCEPT to solve real data reconciliation problems — including a complete, working migration audit framework.

Temporal data is where SQL skills separate practitioners from experts. This lesson teaches you to write production-quality queries for time-series aggregations, gap-filling, point-in-time lookups, and Slowly Changing Dimensions — the four categories of temporal problems every serious data team faces. Leave with patterns you can apply immediately.

Stop writing two-step workarounds and start writing SQL that answers layered questions in a single statement. This lesson teaches you exactly how subqueries work, where to place them, and how correlated subqueries let you compare each row against its own group — with real examples you can run immediately.

Master the art and science of database performance optimization through strategic indexing, query rewriting techniques, and systematic optimization approaches that transform slow queries into lightning-fast operations.

Master sophisticated SQL techniques for user behavior analysis including cohort tracking, conversion funnels, and retention metrics that drive product decisions at data-driven companies.

Master JSON and array operations in SQL databases. Learn to query, extract, and manipulate semi-structured data using native SQL functions and JSONPath expressions.

Master the advanced SQL JOIN patterns that separate expert practitioners from the rest. Learn self joins for hierarchical data, anti joins for exclusion logic, and semi joins for existence checks.