Practice Interview Questions
| Question | Status |
|---|---|
Write a SQL query to retrieve the latest login date for each video game player from the database.
The result should include the player's unique identifier and their corresponding latest login date. Arrange the results based on the proximity of the login dates, so that players with the closest login dates appear first.
player_login table:
| Column Name | Description |
|---|---|
| player_id | Unique identifier for each player |
| login_date | Timestamp of the player's login |
| player_id | latest_login |
|---|---|
| 111 |
Write a SQL query to retrieve the latest login date for each video game player from the database.
The result should include the player's unique identifier and their corresponding latest login date. Arrange the results based on the proximity of the login dates, so that players with the closest login dates appear first.
player_login table:
| Column Name | Description |
|---|---|
| player_id | Unique identifier for each player |
| login_date | Timestamp of the player's login |
| player_id | latest_login |
|---|---|
| 111 |
| 2021-12-25 11:30:00 |
| 121 | 2021-12-24 12:45:00 |
| 2021-12-25 11:30:00 |
| 121 | 2021-12-24 12:45:00 |