MySQL solution, GROUP BY + LEFT JOIN + COUNT DISTINCT
\n# Step 1: Find first day of login for each player\nwith first_login as (\n    select \n        player_id,\n        min(event_date) as event_date \n    from ac
```\n# Step 1: Find first day of login for each player\nwith first_login as (\n    select \n        player_id,\n        min(event_date) as event_date \n    from activity \n    group by 1\n    )\n# Step 2: Join with the source table to check if players come back on the next day\nselect \n    round(count(distinct b.player_id)/count(distinct a.player_id),2) as fraction\nfrom first_login a left join Activity b\non a.event_date=DATE_ADD(b.event_date, interval -1 DAY) \nand a.player_id = b.player_id\n```
['MySQL']