Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Love at first query

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers. →
DouEnergy
August 02, 2023

Love at first query

exploring SQL with DuckDB

DouEnergy

August 02, 2023

Transcript

55 slides
  1. How many of you can set up a Postgres on

    your laptop to analyze a CSV(JSON, Parquet) on AWS S3?
  2. Or

  3. Rolling average of the maximum temperature over the last 7

    days for each date?(過去七日的最高溫平均)
  4. SELECT DATE, TMAX, AVG(TMAX) OVER sevenday AS rolling_7_day_avg FROM R2weather

    WINDOW sevenday AS(ORDER BY DATE ROWS BETWEEN 6 PRECEDING AND CURRENT ROW) LIMIT 20;
  5. SELECT COUNT(*) FILTER (WHERE PRCP BETWEEN 0.1 AND 0.2) low_days,

    AVG(TMAX) FILTER (WHERE PRCP BETWEEN 0.1 AND 0.2) low_prcp_temp, COUNT(*) FILTER (WHERE 0.4 < PRCP) high_days, AVG(TMAX) FILTER (WHERE 0.4 < PRCP) high_prcp_temp FROM R2Weather;
  6. You may say I'm a SQLer But I'm not the

    only one. I hope someday you'll join us.

More Decks by DouEnergy

Other Decks in Programming