We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 11a1c15 commit fa3421dCopy full SHA for fa3421d
MySQL/game-play-analysis-v.sql
@@ -0,0 +1,17 @@
1
+# Time: O(n^2)
2
+# Space: O(n)
3
+
4
+SELECT install_dt,
5
+ Count(player_id) AS installs,
6
+ Round(Count(next_day) / Count(player_id), 2) AS Day1_retention
7
+FROM (SELECT a.player_id,
8
+ a.install_dt,
9
+ b.event_date AS next_day
10
+ FROM (SELECT player_id,
11
+ Min(event_date) AS install_dt
12
+ FROM activity
13
+ GROUP BY player_id) AS a
14
+ LEFT JOIN activity AS b
15
+ ON Datediff(b.event_date, a.install_dt) = 1
16
+ AND a.player_id = b.player_id ) AS t
17
+GROUP BY install_dt;
0 commit comments