How would you use SQL window functions to compute rolling averages for player performance over the last 10 games?
Use the provided player and game-statistics tables. Calculate rolling averages for points, rebounds, and assists independently for each player, using the available games when fewer than 10 prior games exist. NULL points values should be ignored by the average.
rolling_10_game_avg_points, rolling_10_game_avg_rebounds, and rolling_10_game_avg_assists.| Column | Type | Description |
|---|---|---|
| player_idPK | INT | Unique player identifier |
| player_name | VARCHAR(100) | Player's full name |
| position | VARCHAR(20) | Primary basketball position |
| Column | Type | Description |
|---|---|---|
| game_idPK | INT | Unique game-statistics record identifier |
| player_id | INT | Identifier of the player associated with the statistics |
| game_date | DATE | Date of the game |
| game_number | INT | Player's chronological game number |
| points | NUMERIC(6,2) | Points scored in the game |
| rebounds | INT | Total rebounds in the game |
| assists | INT | Total assists in the game |