Write a solution to report the fraction of players that logged in again on the day after the day they first logged in, rounded to 2 decimal places. In other words, you need to count the number of players that logged in for at least two consecutive days starting from their first login date, then divide that number by the total number of players.
WITH day_log AS (
SELECT player_id, MIN(event_date) AS day1, DATE_ADD(MIN(event_date), INTERVAL 1 DAY) AS next_day
FROM Activity
GROUP BY player_id
)
SELECT ROUND(CAST(COUNT(*) AS FLOAT) / (SELECT COUNT(*) FROM day_log), 2) AS fraction
FROM day_log a
INNER JOIN Activity b ON b.player_id = a.player_id AND b.event_date = a.next_day
Your blog has chock-a-block of useful information. I liked your blog's content as well as its look. In my opinion, this is a perfect blog in all aspects. red light therapy panels supplier
Escape to tranquility with Changwon Massage, where our committed managers guarantee a positive experience. Choose a business trip massage for a hygienically safe session, eliminating concerns about reused items. Enjoy stress relief and book your rejuvenating session now. 마산출장마사지