hanze/iwa-panda2

api.sql in main
Repositories | Summary | Log | Files | README.md

api.sql (1008B) download


 1; humidity data                      
 2
 3SELECT DISTINCT temperature, dew_point, nl.name as city, date_time
 4FROM weather_data wd
 5JOIN station s ON wd.station_name = s.name
 6JOIN contract_station cs ON cs.station_name = s.name
 7JOIN nearestlocation nl ON nl.station_name = s.name
 8JOIN country co ON co.country_code = nl.country_code
 9JOIN geolocation geo ON geo.country_code = co.country_code
10JOIN contract c ON cs.contract_id = c.contract_id
11WHERE c.token = ?
12ORDER BY date_time DESC          
13      
14; h data
15
16SELECT distinct temperature, wind_speed, dew_point, DATE(date_time) AS date, nl.name as city
17FROM weather_data wd
18JOIN station s ON wd.station_name = s.name
19JOIN contract_station cs ON cs.station_name = s.name
20JOIN nearestlocation nl ON nl.station_name = s.name
21JOIN country co ON co.country_code = nl.country_code
22JOIN geolocation geo ON geo.country_code = co.country_code
23JOIN contract c ON cs.contract_id = c.contract_id
24WHERE c.token = ?
25ORDER BY date DESC, temperature, wind_speed
26