CREATE TABLE ilmharkus( kuunumber INT, paevanumber INT, kellaaeg TIME, sademed FLOAT, niiskus INT, tempkesk FLOAT, tempmin FLOAT, tempmax FLOAT, tuulesuund INT, tuulekiirus FLOAT, tuulemaxkiirus FLOAT ); LOAD DATA INFILE '/home/jaagup/public_html/2016/abproj/harkuilm.txt' INTO TABLE ilmharkus FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' IGNORE 1 LINES; mysql> SELECT * FROM ilmharkus LIMIT 10; +-----------+-------------+----------+---------+---------+----------+---------+---------+------------+-------------+----------------+ | kuunumber | paevanumber | kellaaeg | sademed | niiskus | tempkesk | tempmin | tempmax | tuulesuund | tuulekiirus | tuulemaxkiirus | +-----------+-------------+----------+---------+---------+----------+---------+---------+------------+-------------+----------------+ | 1 | 1 | 00:00:00 | 0 | 86 | 4.4 | 4.4 | 4.5 | 221 | 5.6 | 10.2 | | 1 | 1 | 01:00:00 | 0 | 87 | 4.3 | 4.1 | 4.5 | 214 | 4.3 | 9 | | 1 | 1 | 02:00:00 | 0 | 89 | 3.9 | 3.8 | 4.1 | 205 | 3.9 | 9.1 | | 1 | 1 | 03:00:00 | 0 | 89 | 3.6 | 3.4 | 3.8 | 208 | 4.3 | 10.5 | | 1 | 1 | 04:00:00 | 0 | 89 | 3.3 | 3 | 3.4 | 211 | 4.4 | 10.1 | | 1 | 1 | 05:00:00 | 0 | 88 | 2.8 | 2.6 | 3 | 207 | 4.4 | 11.9 | | 1 | 1 | 06:00:00 | 0 | 87 | 2.5 | 2.3 | 2.7 | 200 | 4.7 | 9.8 | | 1 | 1 | 07:00:00 | 0 | 86 | 2 | 1.5 | 2.3 | 197 | 5.7 | 10 | | 1 | 1 | 08:00:00 | 0 | 86 | 1.2 | 0.8 | 1.5 | 196 | 5.1 | 9.2 | | 1 | 1 | 09:00:00 | 0 | 84 | 0.7 | 0.6 | 0.9 | 202 | 4.6 | 10.9 | +-----------+-------------+----------+---------+---------+----------+---------+---------+------------+-------------+----------------+ 10 rows in set (0.00 sec) DELETE FROM ilmharkus; CREATE TABLE paevharkus( aasta INT, kuu INT, paev INT, tempkesk FLOAT, tempmin FLOAT, tempmax FLOAT, tuulekiirus FLOAT, sadeohtu FLOAT, sadehommik FLOAT, sadeautomaat FLOAT, PRIMARY KEY (aasta, kuu, paev) ); LOAD DATA INFILE '/home/jaagup/public_html/2016/abproj/harkupaev.txt' INTO TABLE paevharkus FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' IGNORE 1 LINES; mysql> SELECT * FROM paevharkus LIMIT 5 -> ; +-------+-----+------+----------+---------+---------+-------------+----------+------------+--------------+ | aasta | kuu | paev | tempkesk | tempmin | tempmax | tuulekiirus | sadeohtu | sadehommik | sadeautomaat | +-------+-----+------+----------+---------+---------+-------------+----------+------------+--------------+ | 2005 | 1 | 1 | -1.2 | -2.2 | 0 | 3.4 | 0 | 0 | 0 | | 2005 | 1 | 2 | 0.4 | -0.8 | 1 | 5.2 | 0 | 0 | 0.4 | | 2005 | 1 | 3 | 1.1 | -0.1 | 2.6 | 4 | 1.5 | 0.8 | 0.8 | | 2005 | 1 | 4 | 0.4 | -1.4 | 1.8 | 2.3 | 0.9 | 1.3 | 0.8 | | 2005 | 1 | 5 | 1.1 | -0.7 | 2.9 | 5.8 | 6.5 | 4.2 | 5.6 | +-------+-----+------+----------+---------+---------+-------------+----------+------------+--------------+ 5 rows in set (0.00 sec) SELECT MAX(tempkesk) FROM paevharkus; SELECT MAX(tempkesk) FROM paevharkus GROUP BY aasta;