user_id and time_stamp columns from the Logins table.YEAR() function to filter records where the year of the time_stamp is 2020.MAX() function to find the latest time_stamp for each user.user_id to ensure each user appears only once with their latest login timestamp.MAX(time_stamp) as last_stamp to match the expected output column name.
erDiagram
Logins {
int user_id
datetime time_stamp
user_id_time_stamp PK
}