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,
    -- 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;
seasontotal_3p_pointstotal_2p_pointstotal_ft_points
20012626.813157.8000000000014650.3
20022183.411134.8000000000013916.1000000000004
20032272.512314.64463.8
20043283.895573645.6
20053088.510423.64558.6
20063859.799999999999712777.1999999999995833.6
200730639652.24389.3
20082515.811088.1999999999995107.4
20092756.700000000000311041.5999999999994473
20102344.212111.4000000000014974.7
20112635.2000000000003111404391.800000000001
20121877.39999999999998404.1999999999993023.2999999999997
20133604.799999999999310533.3999999999984262.599999999999
20143550.7999999999997111834741.299999999999
20152747.48587.4000000000013574.0000000000005
20164840.50000000000110018.44570.3
20174459.20000000000110753.5999999999995366.7
20184408.2000000000019714.44132.000000000001
20195085.8999999999999477.4000000000014317.8
20204746.5999999999998171.9999999999994054.2
20214499.48480.23455.8999999999996
20223652.200000000000310237.44027.1000000000004
20234188.39616.44463.4
20244870.810669.1999999999994146.5

Share link

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