-- Database schema
| sales_in_weather : date [ DATE ] , store_nbr [ INTEGER ] , item_nbr [ INTEGER ] , units [ INTEGER ] | weather : station_nbr [ INTEGER ] , date [ DATE ] , tmax [ INTEGER ] , tmin [ INTEGER ] , tavg [ INTEGER ] , depart [ INTEGER ] , dewpoint [ INTEGER ] , wetbulb [ INTEGER ] , heat [ INTEGER ] , cool [ INTEGER ] , sunrise [ TEXT ] , sunset [ TEXT ] , codesum [ TEXT ] , snowfall [ REAL ] , preciptotal [ REAL ] , stnpressure [ REAL ] , sealevel [ REAL ] , resultspeed [ REAL ] , resultdir [ INTEGER ] , avgspeed [ REAL ] | relation : store_nbr [ INTEGER ] primary_key relation.store_nbr = sales_in_weather.store_nbr , station_nbr [ INTEGER ] relation.station_nbr = weather.station_nbr |
-- -- Give the average temperature of station no.20 on 2014/10/17.

SELECT tavg FROM weather WHERE `date` = '2014-10-17' AND station_nbr = 20;