Window functions, CTEs, query plans, and performance tuning.
Master recursive Common Table Expressions to query organizational hierarchies, product categories, and any tree-structured data with practical, real-world examples.
Master enterprise-scale data reshaping with dynamic pivots, performance optimization, and integration patterns for modern data architectures. Includes real-world examples and advanced troubleshooting techniques.
Master SQL's PIVOT and UNPIVOT operations to transform row data into columns and vice versa. Learn dynamic pivoting, real-world applications, and troubleshooting tips for reshaping your data effectively.
Master the art of reading database execution plans to diagnose performance bottlenecks and optimize complex queries. Learn advanced techniques for analyzing costs, operators, and optimization patterns across different database systems.
Transform repetitive SQL tasks into efficient, maintainable database objects. Learn to create stored procedures and functions that save time, reduce errors, and organize your SQL code professionally.
Master the essential concepts of database transactions, isolation levels, and locking mechanisms. Learn to build robust, concurrent applications that maintain data integrity under load with practical examples and real-world scenarios.
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.
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 sophisticated SQL techniques for user behavior analysis including cohort tracking, conversion funnels, and retention metrics that drive product decisions at data-driven companies.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Materialized views can turn a 45-second dashboard query into a sub-second one — but only if you understand the storage mechanics, design your aggregations at the right granularity, and choose the right refresh strategy for your availability requirements. This deep-dive lesson covers everything from PostgreSQL internals to multi-tier dependency graphs and cross-platform patterns in Snowflake and BigQuery.
Real-world data is messy — inconsistent formats, buried values, and text that doesn't match any standard. This lesson teaches you how to use SQL's core string functions to filter, extract, and clean text data with precision. By the end, you'll be writing queries that turn chaotic string columns into structured, usable information.
Exact-match SQL queries can't catch "Jon Smith" and "John Smith" as the same person. This hands-on lesson teaches you to build a complete fuzzy deduplication pipeline using similarity functions, smart blocking strategies, and composite scoring — on tables with hundreds of thousands of rows. Walk away with production-ready SQL you can actually use.
Recursive CTEs unlock graph traversal natively in SQL — no application code required. Learn how they actually execute, how to traverse hierarchies in both directions, detect cycles, reconstruct paths, and roll up subtree aggregates, with realistic examples from org charts, bill of materials, and network graphs.
NULL values silently break more SQL queries than most people realize. This lesson teaches you how NULL actually works, why `= NULL` never matches, and how to use COALESCE, NULLIF, and IS NULL to write queries that handle missing data correctly every time.
Stop writing brittle UNION ALL chains to produce summary reports. Learn how ROLLUP, CUBE, and GROUPING SETS let you compute hierarchical subtotals, cross-dimensional totals, and grand totals in a single query pass — and how to use GROUPING() to make the results actually readable.
Most multi-tenant SQL security fails not because of missing features, but because engineers bolt security onto the application layer instead of enforcing it at the database level. This lesson teaches you to implement Row-Level Security, Dynamic Data Masking, and permission-based query filtering in PostgreSQL and SQL Server — security that holds even when your application code has bugs.
Most real-world SQL questions require data from multiple tables — and how you join them determines everything. This lesson breaks down every JOIN type with realistic examples, so you'll know exactly which one to reach for and why.
Truncate-and-reload stops working the moment your tables hit serious scale. This lesson teaches you MERGE, INSERT ON CONFLICT, staging table patterns, and incremental load strategies that production pipelines actually use — complete with row hashing, deduplication, and batching techniques.
Most SQL developers know these features exist but never fully internalize them. This deep-dive lesson teaches you how to combine FILTER, WITHIN GROUP, PERCENTILE_CONT, PERCENTILE_DISC, and MODE into single-pass statistical reports that replace complex multi-query pipelines. Learn the execution model, edge cases, and performance trade-offs that separate expert SQL from advanced SQL.
Dates and times are everywhere in data work, but SQL's datetime functions vary wildly across platforms — and the edge cases produce wrong answers that look right. This lesson teaches you how to cast, truncate, and subtract dates, and how to use interval arithmetic across PostgreSQL, MySQL, BigQuery, and SQL Server.
When indexes alone stop being enough, table partitioning is the next level of SQL performance engineering. Learn how to design range, list, and hash partitioning strategies, verify partition pruning is actually working, and avoid the subtle mistakes that silently kill performance on large datasets.