Solution using subqueries, Beats 85.01%
Intuition\nWe have to find the fraction of players that logged in again on the day after the day they first logged in. So, we have to find at least two consecut
# Intuition\nWe have to find the fraction of players that logged in again on the day after the day they first logged in. So, we have to find at least two consecutive days starting from their first login date.\n\n# Approach\nThis approach uses the subqueries.\n\nIn **SELECT** we get the i**ndividual number of players that is filltered in WHERE function** - looking for the **consecutive days** (in 1 day interval) that is also the **first day** when they logged in AND we **devide it by subquiery of the individual no. of players**.\n\nSo the code in very simplified approach looks like this:\n\nSELECT main query / (Subquery)\nFROM table\nWHERE (query) IN (subquery)\n\n\n# Code\n```mysql []\nSELECT\n    ROUND(COUNT(DISTINCT player_id) / (SELECT COUNT(DISTINCT player_id) FROM Activity), 2) AS fraction\nFROM Activity\nWHERE \n    (player_id, DATE_SUB(event_date, INTERVAL 1 DAY))\n    IN (\n        SELECT player_id, MIN(event_date) AS first_login FROM Activity GROUP BY player_id)\n```
['MySQL']