WITH ranked_players AS (
SELECT
season,
player_id,
player,
pts_per_game,
x3p_per_game,
x2p_per_game,
ft_per_game,g,
ROW_NUMBER() OVER (
PARTITION BY season
ORDER BY pts_per_game DESC
) AS rn
FROM @kaggle.sumitrodatta_nba_aba_baa_stats.player_per_game
)
SELECT
season,
SUM(pts_per_game * g) AS combined_points_top_10,
SUM(x3p_per_game * 3 * g) AS total_3p_points,
SUM(x2p_per_game * 2 * g) AS total_2p_points,
SUM(ft_per_game * g) AS total_ft_points
FROM ranked_players
WHERE season>2000 and season<2025
GROUP BY season
ORDER BY season;