Skip to content

Commit ef72225

Browse files
authored
Update 22-00550-game-play-analysis-iv.sql
1 parent e67835b commit ef72225

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

22-00550-game-play-analysis-iv.sql

+16
Original file line numberDiff line numberDiff line change
@@ -1 +1,17 @@
1+
-- first, create a temp table which has player_id, and date of 1 day after min login date for all players(group by)
2+
-- write a SQL- count total players from Activity where their id and dates are in temp table(date after 1st login)
3+
-- this is done to check if a player logged in after 1st login
4+
-- if they match in temp table, count them
5+
-- then divide by total number of players
16

7+
select
8+
round(count(player_id) / (select count(distinct player_id) from Activity), 2) as fraction
9+
from Activity
10+
where (player_id, event_date) in
11+
(select player_id, adddate(min(event_date), interval 1 day)
12+
from Activity
13+
group by player_id)
14+
15+
16+
-- adobe- 2
17+
-- gsn games- 1

0 commit comments

Comments
 (0)