mysql> use meteob;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> select CAST(HUMIDITY AS UNSIGNED INT) from METEO limit 1;
+--------------------------------+
| CAST(HUMIDITY AS UNSIGNED INT) |
+--------------------------------+
|                             69 |
+--------------------------------+
1 row in set, 1 warning (0,00 sec)

mysql> select CAST(TEMPERATURE AS DECIMAL(5,2)) from METEO limit 1;
+-----------------------------------+
| CAST(TEMPERATURE AS DECIMAL(5,2)) |
+-----------------------------------+
|                              0.90 |
+-----------------------------------+
1 row in set (0,00 sec)

mysql> select avg(temperature),month(mdate) from METEO group by month(mdate) order by month(mdate);
+--------------------+--------------+
| avg(temperature)   | month(mdate) |
+--------------------+--------------+
|  2.362466276238643 |            1 |
|  7.873496049953813 |            2 |
| 11.840677227576967 |            3 |
| 14.992254975310312 |            4 |
|  19.68453711556556 |            5 |
| 25.858309613866332 |            6 |
| 28.634881911114565 |            7 |
| 28.850474397804028 |            8 |
| 20.895183591767093 |            9 |
| 15.274819292770648 |           10 |
|  9.610323779829676 |           11 |
|  6.903833698030965 |           12 |
+--------------------+--------------+
12 rows in set (0,30 sec)

mysql> select avg(temperature),month(mdate) from METEO group by month(mdate) order by avg(temperature);
+--------------------+--------------+
| avg(temperature)   | month(mdate) |
+--------------------+--------------+
|  2.362466276238643 |            1 |
|  6.903833698030965 |           12 |
|  7.873496049953813 |            2 |
|  9.610323779829676 |           11 |
| 11.840677227576967 |            3 |
| 14.992254975310312 |            4 |
| 15.274819292770648 |           10 |
|  19.68453711556556 |            5 |
| 20.895183591767093 |            9 |
| 25.858309613866332 |            6 |
| 28.634881911114565 |            7 |
| 28.850474397804028 |            8 |
+--------------------+--------------+
12 rows in set (0,31 sec)

mysql> select max(temperature),avg(temperature),min(temperature),month(mdate) from METEO group by month(mdate) order by month(mdate);
+------------------+--------------------+------------------+--------------+
| max(temperature) | avg(temperature)   | min(temperature) | month(mdate) |
+------------------+--------------------+------------------+--------------+
| 9.81             |  2.362466276238643 | -1.2             |            1 |
| 9.81             |  7.873496049953813 | -1.2             |            2 |
| 9.81             | 11.840677227576967 | 1.96             |            3 |
| 9.81             | 14.992254975310312 | 1.40             |            4 |
| 9.81             |  19.68453711556556 | 10.0             |            5 |
| 44.76            | 25.858309613866332 | 12.61            |            6 |
| 46.82            | 28.634881911114565 | 14.67            |            7 |
| 47.38            | 28.850474397804028 | 15.60            |            8 |
| 9.81             | 20.895183591767093 | 10.0             |            9 |
| 9.81             | 15.274819292770648 | 10.0             |           10 |
| 9.81             |  9.610323779829676 | -1.2             |           11 |
| 9.81             |  6.903833698030965 | -1.2             |           12 |
+------------------+--------------------+------------------+--------------+
12 rows in set (0,39 sec)

mysql> select count(temperature),month(mdate) from METEO group by month(mdate) having count(temperature)>0.25*avg(temper
ature) order by month(mdate);
+--------------------+--------------+
| count(temperature) | month(mdate) |
+--------------------+--------------+
|              30394 |            1 |
|              28987 |            2 |
|              27081 |            3 |
|              40098 |            4 |
|              44806 |            5 |
|              36749 |            6 |
|              36879 |            7 |
|              35329 |            8 |
|              33471 |            9 |
|              23076 |           10 |
|              16678 |           11 |
|              34275 |           12 |
+--------------------+--------------+
12 rows in set (0,32 sec)

mysql> select avg(temperature),month(mdate) from METEO where(temperature>35 or temperature<0)  group by month(mdate) order by month(mdate);
+---------------------+--------------+
| avg(temperature)    | month(mdate) |
+---------------------+--------------+
|  -3.763642509464485 |            1 |
| -1.5443265306122405 |            2 |
|  35.673124999999985 |            4 |
|    35.5827450980392 |            5 |
|   38.11119110260694 |            6 |
|   39.07182697474389 |            7 |
|   38.77071585903058 |            8 |
|  37.497499999999874 |            9 |
| -1.3398888888888887 |           11 |
|   -2.08990109890112 |           12 |
+---------------------+--------------+
10 rows in set (0,25 sec)

mysql> select count(distinct temperature) from METEO;
+-----------------------------+
| count(distinct temperature) |
+-----------------------------+
|                         302 |
+-----------------------------+
1 row in set (0,50 sec)

mysql> select avg(temperature),month(mdate) from METEO where(humidity<50 and wind_count>20) group by month(mdate) order
by month(mdate);
+--------------------+--------------+
| avg(temperature)   | month(mdate) |
+--------------------+--------------+
|   7.61681818181818 |            1 |
| 11.973602484472034 |            2 |
| 11.479982886480288 |            3 |
| 11.864968253968238 |            4 |
| 13.471188118811884 |            5 |
| 15.610000000000001 |            6 |
| 15.232857142857146 |            7 |
|              12.99 |            9 |
| 11.622512562814046 |           10 |
| 12.043245125348173 |           11 |
|  8.669365904365883 |           12 |
+--------------------+--------------+
11 rows in set (0,23 sec)

mysql> select count(distinct wind_direction) from METEO;
+--------------------------------+
| count(distinct wind_direction) |
+--------------------------------+
|                            214 |
+--------------------------------+
1 row in set (0,42 sec)

mysql>select max(rain_count),month(mdate) from METEO group by month(mdate) having count(rain_count)>0 order by max(rain
_count);
+-----------------+--------------+
| max(rain_count) | month(mdate) |
+-----------------+--------------+
| 1.676           |            8 |
| 3.911           |            9 |
| 4.190           |            7 |
| 4.470           |            5 |
| 7.823           |            6 |
| 8.940           |            4 |
| 85.496          |           10 |
| 9.778           |            2 |
| 9.778           |           12 |
| 9.778           |            3 |
| 9.778           |            1 |
| 9.778           |           11 |
+-----------------+--------------+
12 rows in set (0,31 sec)