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 season>2000 and season<2025
GROUP BY season
ORDER BY season;
seasoncombined_points_top_10total_3p_pointstotal_2p_pointstotal_ft_points
2001242030.0000000000336276.299999999974158444.4000000001447305.89999999998
2002241355.2999999999639485.39999999998156630.6000000000345133.60000000004
2003238839.699999999938682.60000000001153534.8000000000846459.999999999985
2004250741.3000000001341355.89999999999160940.0000000003548396.19999999997
2005264756.699999999646909.19999999997164880.652997.59999999996
2006257972.699999999945964.49999999995159883.3999999998852147.60000000004
2007256462.4000000000247549.99999999997157970.5999999998350955.699999999946
2008267461.300000000152395.000000000015164935.2000000000749933.1
2009272528.7999999999355596.29999999999165264.399999999751679.499999999935
2010270747.100000000451941.100000000006168591.9999999996250402.30000000002
2011281255.999999999356754.899999999994172154.2000000001652453.10000000005
2012200924.739995.7125682.3999999999735344.500000000015
2013256937.4999999999756920.799999999974156846.8000000000843351.50000000005
2014269972.899999999963047.7159461.8000000000547583.499999999956
2015278736.766323.70000000003165258.3999999999447285.10000000007
2016269204.6000000002767671.30000000002155381.000000000146243.399999999965
2017282491.000000000578456.615671747535.600000000064
2018284328.284111.59999999987155748.800000000144530.499999999985
2019312424.300000000697953.60000000005165028.800000000149480.29999999999
2020258089.000000000285762.5131536.600000000141058.799999999996
2021270746.291518.90000000011138259.999999999641130.89999999993
2022304953.5999999995103157.09999999998155072.5999999997446856.79999999999
2023314584.30000000005103430.1000000001161249.5999999997449989.300000000025
2024310885.4999999996105893.10000000006158946.999999999945959.79999999999

Share link

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