File tree 3 files changed +33
-2
lines changed
solution/0500-0599/0550.Game Play Analysis IV
3 files changed +33
-2
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,17 @@ Result table:
56
56
### ** SQL**
57
57
58
58
``` sql
59
-
59
+ # Write your MySQL query statement below
60
+ SELECT round( AVG ( b .event_date IS NOT NULL ),2 ) fraction
61
+ FROM
62
+ (
63
+ SELECT player_id
64
+ ,MIN ( event_date ) AS event_date
65
+ FROM activity
66
+ GROUP BY player_id
67
+ ) a
68
+ LEFT JOIN activity b
69
+ ON a .player_id = b .player_id AND DATEDIFF( a .event_date , b .event_date ) = - 1
60
70
```
61
71
62
72
<!-- tabs:end -->
Original file line number Diff line number Diff line change @@ -58,7 +58,17 @@ Only the player with id 1 logged back in after the first day he had logged in so
58
58
### ** SQL**
59
59
60
60
``` sql
61
-
61
+ # Write your MySQL query statement below
62
+ SELECT round( AVG ( b .event_date IS NOT NULL ),2 ) fraction
63
+ FROM
64
+ (
65
+ SELECT player_id
66
+ ,MIN ( event_date ) AS event_date
67
+ FROM activity
68
+ GROUP BY player_id
69
+ ) a
70
+ LEFT JOIN activity b
71
+ ON a .player_id = b .player_id AND DATEDIFF( a .event_date , b .event_date ) = - 1
62
72
```
63
73
64
74
<!-- tabs:end -->
Original file line number Diff line number Diff line change
1
+ # Write your MySQL query statement below
2
+ SELECT round( AVG ( b .event_date IS NOT NULL ),2 ) fraction
3
+ FROM
4
+ (
5
+ SELECT player_id
6
+ ,MIN ( event_date ) AS event_date
7
+ FROM activity
8
+ GROUP BY player_id
9
+ ) a
10
+ LEFT JOIN activity b
11
+ ON a .player_id = b .player_id AND DATEDIFF( a .event_date , b .event_date ) = - 1
You can’t perform that action at this time.
0 commit comments