Game Play Analysis I

You can find the first login date for each player by selecting the minimum event_date for each player_id. Here’s a MySQL query that achieves this:

1
2
3
SELECT player_id, MIN(event_date) AS first_login
FROM Activity
GROUP BY player_id;

Explanation:

  • The MIN function is used to get the earliest event_date for each player_id, which corresponds to the first login date.
  • The GROUP BY clause groups the results by player_id, so the query calculates the minimum event_date separately for each player.