Ranking cold weather
You are working for the national weather agency for the US. Texas has been experiencing some unusually cold weather later and you have been tasked to analyze historical data and rank the coldest temperatures.
Rank the TX weather station data by t_monthly_min. Rank 1 should appear first and have the lowest temperature. Temperatures that are the same should have the same rank.
You will need to join temperatures_monthly and temperature_stations.
이 연습은 강의의 일부입니다
Time Series Analysis in PostgreSQL
연습 안내
- Rank
t_monthly_minfor theTXweather station by joining the two tables and partitioning bystation_id; rank1should have the lowest temperature.
실습형 인터랙티브 연습
이 예제를 이 샘플 코드를 완성하여 풀어보세요.
-- Rank the lowest temperatures in Texas
SELECT
ts.state,
year_month,
t_monthly_min,
___ (
___
___) AS rank
FROM temperatures_monthly AS tm
___ AS ts
USING(___)
___
ORDER BY rank;