SUM()
window function to calculate the cumulative sum of games played.player_id
to ensure the cumulative sum is calculated separately for each player.event_date
in ascending order to ensure the games are summed in chronological order.player_id
, event_date
, and the calculated cumulative sum as games_played_so_far
.erDiagram Activity { int player_id int device_id date event_date int games_played player_id event_date PK }