BaşlayınÜcretsiz Başlayın

Single running average

As a researcher at the national weather agency, you want to run more analysis on the latest temperature data and you've just learned how to do running averages. You're keen to gain new insights and show them to the rest of the team.

Your task is to calculate the running average of the lowest monthly temperatures in Hawaii in the available dataset.

Bu egzersiz

Time Series Analysis in PostgreSQL

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Use a window function to calculate the running average for t_monthly_min for a single weather station in Hawaii, HI.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

-- Calculate the running average of the lowest temperates in Hawaii
SELECT
	ts.state,
	year_month,
	t_monthly_min,
    ___ AS running_avg_temp
FROM temperatures_monthly AS tm
JOIN temperature_stations AS ts 
	USING(station_id)
WHERE state = 'HI'
ORDER BY year_month;
Kodu Düzenle ve Çalıştır