Using CTE and DATEADD function
IntuitionApproachDATEADD() function is really handy to add day, month or year to a choosen date. It was helpful in this question as we needed consecutive dates.
# Intuition
<!-- Describe your first thoughts on how to solve this problem. --> It is essential to get the min date and next day for each player.

# Approach
<!-- Describe your approach to solving the problem. -->
DATEADD() function is really handy to add day, month or year to a choosen date. It was helpful in this question as we needed consecutive dates.

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```mssql []
with cte as (
select player_id, event_date,dateadd(day,1,min(event_date)over(partition by player_id)) as day2 from activity
group by player_id, event_date)

select  round(cast(sum(case when event_date=day2 then 1 else 0 end) as decimal (10,2))/cast(count(distinct player_id) as decimal (10,2)),2) as fraction 
from cte 
```
['MS SQL Server']