AlgoMaster Logo

Running Totals and Cumulative Calculations

Last Updated: May 3, 2026

5 min read

Running totals come up constantly in SQL interviews at finance, analytics, and FAANG companies. The basic SUM() OVER(ORDER BY) syntax is covered in the Window Aggregates chapter. Here we focus on the harder patterns: cumulative percentages, partitioned accumulators, resetting totals at boundaries, and tracking balances that can go negative.

Premium Content

Subscribe to unlock full access to this content and more premium articles.