Baselight
WITH inflation_data 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
    fire_data."year",
    fire_data."fires",
    fire_data."acres",
    CAST(REPLACE(REPLACE(fire_data."total", '$', ''), ',', '') AS BIGINT) AS "cost (nominal)",
    CAST(REPLACE(REPLACE(fire_data."total", '$', ''), ',', '') AS BIGINT) / inflation_data."comp_inflation" * (SELECT "comp_inflation" FROM inflation_data WHERE "year" = 2020 ) AS "cost (inflation-adjusted)",
    CAST(REPLACE(REPLACE(fire_data."doiagencies", '$', ''), ',', '') AS BIGINT) AS "department of interior costs",
        fire_data."acres",
    CAST(REPLACE(REPLACE(fire_data."forestservice", '$', ''), ',', '') AS BIGINT) AS "forestservice cost"
FROM
    @kaggle.kkhandekar_total_wildfires_acres_affected_1983_2020.federal_firefighting_costs_suppression_only AS fire_data
INNER JOIN inflation_data
    ON fire_data."year" = inflation_data."year"
yearfiresacrescost (nominal)cost (inflation-adjusted)department of interior costsacres_1forestservice cost
1985825912896147239943000576544613.2501694784380002896147161505000
1986859072719162202778000477689282.8453737911530002719162111625000
1987713002447296335109000759062287.7321994814520002447296253657000
19887275050092905789260001260901143.03695921493170005009290429609000
19894894918273104997870001036701293.30619721681150001827310331672000
1990664814621621397952000786158433.15688241442520004621621253700000
1991757542953578206120000391531024.04091793738200002953578132300000
1992873942069929377466000696124086.0759265871660002069929290300000
1993588101797574240436000430497953.57316434564360001797574184000000
19947910740735799183350001596377172.8714351611350004073579757200000
1995822341840546477126000805249068.03787241101260001840546367000000
19969636360659987011830001148923998.93634871536830006065998547500000
1997661962856959284148000456461711.989322961050480002856959179100000
1998810431329704416704000656277097.63235391099040001329704306800000
1999924875626093515516000795978902.08576261544160005626093361100000
200092250738349314108020002114892268.97404833480200073834931076000000
20018407935709119526960001386562020.0098122695740003570911683122000
200273457718471216740400002388639542.13366539504000071847121279000000
200363629396084213271380001856524561.614820730363800039608421023500000
200465461809788010072440001367987342.6579212812440008097880726000000
20056675386893898189540001079865518.47453452940540008689389524900000
200696385987374517044770002182046925.229959542405800098737451280419000
200785705932804516201450002013676031.556604947049100093280451149654000
200878979529246815858560001895248345.945906439278300052924681193073000
20097879259217869205290001100119471.53161382184180005921786702111000
2010719713422724809499000948458911.57913472312140003422724578285000
201174126871136713745250001563571059.585506231878900087113671055736000
201267774932623819024460002121666634.943913246583200093262381436614000
201347579431954617409340001922320253.333192839919900043195461341735000
201463212359561315221490001647784561.581439332619400035956131195955000
2015681511012514921305430002306394356.3904743417543000101251491713000000
201667595550353819755450002117428799.943600237173900055035381603806000
2017714991002608629181650003066419454.66508000000100260862410165000
201858083876749231432560003238182331.200000352800000087674922615256000
201950477466436415900000001605899999.999999844000000046643641150000000
2020589501012233622740000002274000000510000000101223361764000000

Share link

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