bugfree Icon
interview-course
interview-course
interview-course
interview-course
interview-course
interview-course
interview-course
interview-course

Leetcode Problem 534. Game Play Analysis III

534. Game Play Analysis III

Leetcode Solutions

Cumulative Sum with Window Function

  1. Use the SUM() window function to calculate the cumulative sum of games played.
  2. Partition the result set by player_id to ensure the cumulative sum is calculated separately for each player.
  3. Order the partition by event_date in ascending order to ensure the games are summed in chronological order.
  4. Select the 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
    }

Cumulative Sum with Self-Join and Aggregation

Ask Question

Programming Language
image/screenshot of info(optional)
Full Screen
Loading...

Suggested Answer

Answer
Full Screen
Copy Answer Code
Loading...