開始使用免費開始

計算每月氣溫震盪幅度

你是一位從事天氣專案的資料科學家。你先前已經分析過每月最低與最高氣溫如何隨時間與地點而變化。

現在你想關注每月的氣溫震盪幅度。其公式為:

每月最高氣溫 - 每月最低氣溫。

temperature_stationstemperatures_monthly 已可供你使用。

本練習屬於課程

PostgreSQL 的時間序列分析

檢視課程

動手互動練習

試著完成這個範例程式碼,體驗一下這個練習。

-- Calculate monthly temperature swing per location and month
SELECT
  state,
  year_month,
  ___ AS monthly_swing
FROM ___
___
ORDER BY state, year_month;
編輯並執行程式碼