Easy MYSQL solution use CTE and window function ( LEAD , FIRST_VALUE )
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\n# Write your MySQL query statement below\nwith cte as(\n    select player_id,\n    event_date as cur,\n    lead(event_date,1) over(PARTITION BY player_id\n                            ORDER BY event_date) as \'next\',\n    FIRST_VALUE(event_date) over(PARTITION BY player_id\n                            ORDER BY event_date) as \'fir\'\n    from Activity\n)\nselect round(count(distinct player_id)\n/(select count(distinct player_id) \nfrom Activity),2) as fraction  \nfrom cte\nwhere cur + interval 1 day=next and\ncur=fir;\n\n```
['MySQL']