A window function calculates over related rows while keeping individual rows visible. GROUP BY collapses rows; a window total can sit beside each original order. Define PARTITION BY to choose the population and ORDER BY to choose the sequence.
A running total needs an explicit frame when tied ordering values could change its meaning. ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW advances one row at a time. Add a stable key to the ordering so tied timestamps have a deterministic sequence.
ROW_NUMBER assigns a unique position; DENSE_RANK gives equal values the same rank. Choose based on the report's promise. LAG returns a previous value within the chosen partition and leaves the first row missing unless you supply a fallback. The exercises preserve order IDs so you can inspect both the calculation and the source row.
Partition the sum by the tenant whose total each row should display.