Baselight
WITH stock_t AS
(
SELECT YEAR("date") AS "year", "open" AS "open_price"
FROM (SELECT "date", "open", 
      ROW_NUMBER() OVER (partition by EXTRACT(YEAR FROM "date"), EXTRACT(MONTH FROM "date") ORDER BY EXTRACT(DAY FROM "date")) AS seq
      FROM @kaggle.rprkh15_sp500_stock_prices.mmm
     ) t
WHERE seq = 1 AND MONTH("date")=1 AND "open" != 0
ORDER BY 1
),
name_t AS
(
SELECT "year", SUM("count") AS "babies"
FROM @kaggle.robikscube_us_baby_name_popularity.names
WHERE "name" = 'Rose'
GROUP BY "year"
)
SELECT stock_t."year", stock_t."open_price"*15 AS "scaled 3M stock price", name_t."babies" AS "babies named rose"
FROM stock_t, name_t
WHERE stock_t."year" = name_t."year" AND stock_t."year" > 2000
ORDER BY 1
yearscaled 3m stock pricebabies named rose
2001508.92806600761711029
2002514.9689578716947922
2003553.6233222398104853
2004778.1297846720829894
2005765.7556927600481967
2006740.5333306602463961
2007756.0980069289682942
2008840.8246405227843974
2009590.6537506713348939
2010881.6241156355022962
2011944.06995591671011098
2012935.19807286838271251
20131079.98811139487471427
20141618.50907373634781697
20151977.90598199639341950
20161824.65423029421442039
20172263.05262077790532080
20183053.81361774660952451
20192497.16941347647032522
20202441.94945459657632377
20212494.67231911582672377

Share link

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