SELECT
statement to choose the columns gender
, day
, and the calculated total score.SUM()
function as a window function over the score_points
column.gender
to calculate the total separately for each gender.day
to ensure the scores are summed in chronological order.OVER()
clause to define the window specification.gender
and day
in ascending order.erDiagram Scores { varchar player_name varchar gender date day int score_points gender_day PK gender day }