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

Temperature percentile

You are working for a national weather agency and have been tasked to create a report that indicates what percentile a month falls in based on its hottest temperatures. Knowing the percentile will help rank the hottest months.

You will be looking at weather data from California, CA.

Bu egzersiz, kursun bir parçasıdır

Time Series Analysis in PostgreSQL

Kursa Göz Atın

Egzersiz talimatları

  • Rank the t_monthly_max for the state of CA and have this ranking be a percentile.

Uygulamalı etkileşimli egzersiz

Bu egzersizi bu örnek kodu tamamlayarak deneyin.

-- Rank the hottest months with a percentile
SELECT
	ts.state,
	year_month,
	t_monthly_max,
    ___ OVER (ORDER BY t_monthly_max DESC) AS percent_rank
FROM temperatures_monthly AS tm
JOIN temperature_stations AS ts 
	USING(station_id)
WHERE state = 'CA'
ORDER BY percent_rank;
Kodu Düzenle ve Çalıştır