Skip to content

Practice Game Play Analysis I

Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.

Easy#511
LeetCode Problem

Game Play Analysis I

Problem Statement

Tables: Activity(player_id INT, device_id INT, event_date DATE, games_played INT). Activity has the composite key (player_id, event_date). A login may record zero games. Return player_id and first_login, the earliest recorded event_date for each player. Output order is unrestricted.

Source: Game Play Analysis I on LeetCode. Use the original task for its coding environment and submissions.

Examples

# Example 1

Input
Activity table: +-----------+-----------+------------+--------------+ | player_id | device_id | event_date | games_played | +-----------+-----------+------------+--------------+ | 1         | 2         | 2016-03-01 | 5            | | 1         | 2         | 2016-05-02 | 6            | | 2         | 3         | 2017-06-25 | 1            | | 3         | 1         | 2016-03-02 | 0            | | 3         | 4         | 2018-07-03 | 5            | +-----------+-----------+------------+--------------+
Output
+-----------+-------------+ | player_id | first_login | +-----------+-------------+ | 1         | 2016-03-01  | | 2         | 2017-06-25  | | 3         | 2016-03-02  | +-----------+-------------+

Related LeetCode Problems

Practice more problems similar to Game Play Analysis I.

Review your practice with PhantomCodeAI

After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.