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

Leetcode Problem 1097. Game Play Analysis V

1097. Game Play Analysis V

Leetcode Solutions

Calculating Day One Retention Using SQL and Pandas

  1. Create a Common Table Expression (CTE) to identify the first login date for each player.
  2. Use a LEFT JOIN to find players who logged in the day after their first login and create an indicator variable for consecutive logins.
  3. Group the results by the first login date and calculate the number of installs and the sum of the indicator variable.
  4. Calculate the day one retention rate by dividing the sum of the indicator variable by the number of installs and rounding to two decimal places.
  5. Select the required columns for the final output.

erDiagram
    Activity {
        int player_id
        int device_id
        date event_date
        int games_played
    }

Ask Question

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

Suggested Answer

Answer
Full Screen
Copy Answer Code
Loading...