Rising Temperature

2pts
Uber

Problem Statement

Weather monitoring is crucial for logistics and ride-sharing demand forecasting. You are analyzing daily temperature fluctuations to detect significant warming trends.

Write an SQL query to find all dates IDs with higher temperatures compared to its previous dates (yesterday).

Rules:

  • The comparison must be made against the temperature of the immediate previous calendar day.
  • If a date has no record for the previous day, it should not be included.
  • Return the result table containing only the id column.
  • Results must be sorted by id in ascending order.
Tests your understanding of
Basic SQL, Self Join, Date Functions and Filtering

Input Tables

weather
id(INTEGER)record_date(DATE)temperature(INTEGER)
12024-01-0110
22024-01-0225
32024-01-0320
42024-01-0430
52024-01-0640
62024-01-0735
72024-01-0850

Expected Output

id(INTEGER)
2
4
7

Tags

EasyBasic SQLSelf JoinDate FunctionsFiltering
15-20 min
45%

Hints