Windowing Functions for Database Analytics
summary
Introduction to SQL window functions with concrete MySQL 8.0 examples showing how to get running totals, moving averages, quartiles and percent ranks from table data. Demonstrates actual queries: MySQL 8.0 syntax, ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW frames, and LEAD/LAG for offsets; contrasts mistaken aggregate SUM() use vs partitioned window SUM(), shows partitioning by column, named windows, row_number/rank/dense_rank outputs, and handling of NULL and rollup so queries produce the per-row analytics expected.
AI-written summary · about
chapters (12)
- 0:00Introduction to talk
- 1:08What are windowing functions
- 3:39Aggregate vs window functions
- 8:58Key windowing function syntax
- 12:47Window frames and partitions
- 16:43Running totals by department
- 21:58Ranking and percentiles
- 24:09Calculating percentages
- 24:54Quartiles and averages
- 26:17Lead and lag functions
- 28:44Syntax and window definition
- 29:05Resources and closing
related talks
50mCommon table expressions (CTE) and window functions in MySQL 8.0
01h 06mPostgres Window Magic
34mCommon Table Expressions and Window Functions simple, maintainable, fast queries
51mUnderstanding window functions in DAX
46mT-SQL Window Function Performance
44mBeyond WHERE and GROUP BY
49mModern T SQL for Better Performance
01h 00mComplex Queries with Modern SQL
