select b.name, a.name, avg(c.humidity), case AVG(c.temperature) when <= 15 then 'COLD' WHEN >= 30 'HOT' ELSE 'WARM' end from country a, state b, state_weather_stats c where a.id = b.country_id and b.id = c.state_id and c.record_date between '2018-11-01' and '2018-11-30' group by a.name,b.name;
can someone help on this