This question is part of a bigger mySQL query I have. So I have a table of 'playerIds', 'dates', 'scores' and 'problems'. It's Table T0 in the image attached. I am running a SQL query on it to get the most-recent row for all players where the 'date' is <= (2020-08-14 - 7days). Not all players will have a row with a date that satisfies that condition, so naturally those playerId rows will not appear in the resulting table (Table T1 in the pic).
Now what I want to do is to include those missing rows with 0 values for 'score' and 'problems' in the resulting table (See Table T2 in the pic). I am totally at a loss as to how to go about it since I am very new to SQL queries.
Here's the part of the SQL query which is producing Table T1 from T0, but I want to modify it such that it produces Table T2 from T0:
select *
from (
select *, row_number() over (partition by playerId order by date desc) as ranking
from player
where date<=date_add(date('2020-08-14'),interval -7 day)
) t
where t.ranking = 1