SQL interview Questions – Leetcode 511 – Game Play Analysis I

Problem Description –

Write an SQL query that reports the first login date for each player.

The query result format is in the following example:

Difficulty Level – Easy

Solution –

SELECT 
    player_id,
    MIN(event_date) as first_login
FROM Activity
GROUP BY player_id

To get the result, we have to first group the data by each player using and then we have to use the MIN() function which we give us the first login date of each players.

Rating: 1 out of 5.

Leave a Reply