Baselight
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,
    -- 3 points total for the top 10 players
    SUM(x3p_per_game * 3 * g) AS total_3p_points,
    -- 2 points total for the top 10 players
    SUM(x2p_per_game * 2 * g) AS total_2p_points,
    -- Free throw total for the top 10 players
    SUM(ft_per_game * g)      AS total_ft_points
FROM ranked_players
WHERE rn <= 10 AND season>2000 and season<2025
GROUP BY season
ORDER BY season;
seasoncombined_points_top_10total_3p_pointstotal_2p_pointstotal_ft_points
200120402.1999999999972626.813157.8000000000014650.3
200217196.6000000000022183.411134.8000000000013916.1000000000004
200319052.12272.512314.64463.8
200416491.33283.895573645.6
200518086.7000000000043088.510423.64558.6
200622454.23859.799999999999712777.1999999999995833.6
200717051.10000000000230639652.24389.3
200818710.22515.811088.1999999999995107.4
200918275.3000000000032756.700000000000311041.5999999999994473
201019415.8000000000032344.212111.4000000000014974.7
201118150.22635.2000000000003111404391.800000000001
201213313.91877.39999999999998404.1999999999993023.2999999999997
201318425.6999999999973604.799999999999310533.3999999999984262.599999999999
201419458.23550.7999999999997111834741.299999999999
201514928.5999999999992747.48587.4000000000013574.0000000000005
201619406.4999999999964840.50000000000110018.44570.3
201720571.94459.20000000000110753.5999999999995366.7
201818260.34408.2000000000019714.44132.000000000001
201918893.7000000000045085.8999999999999477.4000000000014317.8
202016947.34746.5999999999998171.9999999999994054.2
202116449.74499.48480.23455.8999999999996
2022179123652.200000000000310237.44027.1000000000004
202318274.3999999999984188.39616.44463.4
202419710.24870.810669.1999999999994146.5

Share link

Anyone who has the link will be able to view this.