Game Play Analysis I
<p>Table: <code>Activity</code></p>

<pre>
+--------------+---------+
| Column Name  | Type    |
+--------------+---------+
| player_id    | int     |
| device_id    | int     |
| event_date   | date    |
| games_played | int     |
+--------------+---------+
(player_id, event_date) is the primary key (combination of columns with unique values) of this table.
This table shows the activity of players of some games.
Each row is a record of a player who logged in and played a number of games (possibly 0) before logging out on someday using some device.
</pre>

<p>&nbsp;</p>

<p>Write a solution to find the <strong>first login date</strong> for each player.</p>

<p>Return the result table in <strong>any order</strong>.</p>

<p>The result format is in the following example.</p>

<p>&nbsp;</p>
<p><strong class="example">Example 1:</strong></p>

<pre>
<strong>Input:</strong> 
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            |
+-----------+-----------+------------+--------------+
<strong>Output:</strong> 
+-----------+-------------+
| player_id | first_login |
+-----------+-------------+
| 1         | 2016-03-01  |
| 2         | 2017-06-25  |
| 3         | 2016-03-02  |
+-----------+-------------+
</pre>

['game-play-analysis-ii']
['Create table If Not Exists Activity (player_id int, device_id int, event_date date, games_played int)', 'Truncate table Activity', "insert into Activity (player_id, device_id, event_date, games_played) values ('1', '2', '2016-03-01', '5')", "insert into Activity (player_id, device_id, event_date, games_played) values ('1', '2', '2016-05-02', '6')", "insert into Activity (player_id, device_id, event_date, games_played) values ('2', '3', '2017-06-25', '1')", "insert into Activity (player_id, device_id, event_date, games_played) values ('3', '1', '2016-03-02', '0')", "insert into Activity (player_id, device_id, event_date, games_played) values ('3', '4', '2018-07-03', '5')"]
[{"value": "mysql", "text": "MySQL", "defaultCode": "# Write your MySQL query statement below\n"}, {"value": "mssql", "text": "MS SQL Server", "defaultCode": "/* Write your T-SQL query statement below */\n"}, {"value": "oraclesql", "text": "Oracle", "defaultCode": "/* Write your PL/SQL query statement below */\n"}, {"value": "pythondata", "text": "Pandas", "defaultCode": "import pandas as pd\n\ndef game_analysis(activity: pd.DataFrame) -> pd.DataFrame:\n    "}, {"value": "postgresql", "text": "PostgreSQL", "defaultCode": "-- Write your PostgreSQL query statement below\n"}]
{"mysql": ["Create table If Not Exists Activity (player_id int, device_id int, event_date date, games_played int)"], "mssql": ["Create table Activity (player_id int, device_id int, event_date date, games_played int)"], "oraclesql": ["Create table Activity (player_id int, device_id int, event_date date, games_played int)", "ALTER SESSION SET nls_date_format='YYYY-MM-DD'"], "database": true, "name": "game_analysis", "pythondata": ["Activity = pd.DataFrame([], columns=['player_id', 'device_id', 'event_date', 'games_played']).astype({'player_id':'Int64', 'device_id':'Int64', 'event_date':'datetime64[ns]', 'games_played':'Int64'})"], "manual": false, "postgresql": ["Create table If Not Exists Activity (player_id int, device_id int, event_date date, games_played int)"], "database_schema": {"Activity": {"player_id": "INT", "device_id": "INT", "event_date": "DATE", "games_played": "INT"}}}
{"mysql": ["MySQL", "<p><code>MySQL 8.0</code>.</p>"], "mssql": ["MS SQL Server", "<p><code>mssql server 2019</code>.</p>"], "oraclesql": ["Oracle", "<p><code>Oracle Sql 11.2</code>.</p>"], "pythondata": ["Pandas", "<p>Python 3.10 with Pandas 2.2.2 and NumPy 1.26.4</p>"], "postgresql": ["PostgreSQL", "<p>PostgreSQL 16</p>"]}
['Database']