Skip to main content

LeetCode 511. Game Play Analysis I SQL Solution

Problem

LeetCode SQL Problem

  1. Game Play Analysis I

Activity table

player_iddevice_idevent_dategames_played
122016-03-015
122016-05-026
232017-06-251
312016-03-020
342018-07-035

Solution

Report the first login date for each player
SELECT player_id
,min(event_date) AS first_login
FROM Activity
GROUP BY player_id

Query Output

player_idfirst_login
12016-03-01
22017-06-25
32016-03-02