Baselight
WITH inflation_t AS 
(
  SELECT 
    "year", 
    "inflation_rate", 
    EXP(SUM(LN(1 + "inflation_rate")) OVER (ORDER BY "year")) as "comp_inflation"
  FROM @kaggle.prasertk_300_years_of_inflation_rate_in_us.inflation_data_1701_2022
  WHERE "year" >= 1985
  ORDER BY "year"
)
SELECT 
  YEAR(ratings_t."date") AS "year", 
  "household_rating" AS "rating", 
  "cost_of_30_second_ad_usd" AS "cost_per_30s (nominal)", 
  "cost_of_30_second_ad_usd" / "comp_inflation" * (SELECT "comp_inflation" FROM inflation_t WHERE "year" = 2020) AS "cost_per_30s (inflation-adjusted)",
  "average_viewers" / "cost_of_30_second_ad_usd" AS "viewers_per_dollar (nominal)",
  "average_viewers" / ("cost_of_30_second_ad_usd" / "comp_inflation" * (SELECT "comp_inflation" FROM inflation_t WHERE "year" = 2020)) AS "viewers_per_dollar (inflation-adjusted)"
FROM @kaggle.mattop_super_bowl_television_ratings.super_bowl_ratings ratings_t
INNER JOIN inflation_t
    ON YEAR(ratings_t."date") = inflation_t."year"
ORDER BY "year"
yearratingcost_per_30s (nominal)cost_per_30s (inflation-adjusted)viewers_per_dollar (nominal)viewers_per_dollar (inflation-adjusted)
198546.45250001261490.9455843219162.914285714285767.80072445179744
198648.35500001295648.9637187247168.309090909090971.44682131671603
198745.86000001359072.3395650957145.3166666666666664.15405380695252
198841.96450001404810.3509927671124.2480620155038857.046846176329616
198943.56750001400143.2069695354120.8740740740740758.27261068286942
1990397004001383647.692644039105.4397487150199953.37341318358188
199141.98000001519623.613587882699.387552.32216667933595
199240.38500001567572.902366140693.6352941176470650.77275824292734
199345.18500001521915.4391904275107.0470588235294159.78650170498402
199445.59000001564504.734747441310057.52619215596605
199541.311500001940863.478920774372.539130434782642.98086954904528
19964610850001777827.66958973486.7096774193548352.91851488716602
199743.312000001927706.879468402173.22545.582656230511375
199844.512911002033384.27457651569.7080009294400244.26118620335251
199940.216000002470468.895896965652.32533.88830360869747
200043.321000003148048.957150259542.12857142857142628.10312075962332
200140.422000003201899.078007661338.33636363636363626.340617847480512
200240.422000003139116.743144765539.4545454545454527.65109013213819
200340.722000003077565.434455652340.2909090909090928.80198711865189
200441.423022003126730.42506787439.00616801320476428.720096647938764
200541.124000003164618.823937465435.862527.19758833163687
200641.625000003200464.020972355736.328.355263300984898
200742.623853652964766.935684164539.0632041637233731.429114672886527
200843.126999633226711.889266835536.0930872015653530.201023005540886
20094230000003585284.564196067432.9127.537563122869816
20104528000003280652.542401629538.0285714285714332.45695745702177
20114629486493354193.078536762437.6579240187624933.104832488784524
20124734427523839463.53840604532.3433113973937129.001447438208256
201346.437651304157415.30433227528.8675291424200526.14364744526209
201446.740848644422021.65186181227.4648066618619425.37074868296143
201547.542831294636651.10410462326.7187843279994624.681606925026408
201646.648000005144736.38400000123.30416666666666721.74261063168985
201745.353998735674208.14789220.61529965612154319.618596480524953
201843.152353795393487.44580000119.76361214727720719.184247861849354
201941.151999165251915.15999999918.93876747239763218.751254923165973
202041.654000005399999.99999999918.76296296296296318.762962962962966
202138.255000005238095.23809523717.85454545454545518.74727272727273

Share link

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