USE mytools;
DROP TABLE IF EXISTS temperatures;
CREATE TABLE temperatures (temper INT, city CHAR(20));

INSERT INTO temperatures VALUES(78,'sf');
INSERT INTO temperatures VALUES(NULL,'sf');
INSERT INTO temperatures VALUES(42,NULL);
INSERT INTO temperatures VALUES(NULL,'ny');
SELECT * FROM temperatures;

SELECT @avg1 := AVG(temper) FROM temperatures; 
update temperatures
set temper = @avg1
where ISNULL(temper);
SELECT * FROM temperatures;

SELECT @city1 := (SELECT city FROM temperatures GROUP BY city ORDER BY COUNT(*) DESC LIMIT 1);

update temperatures
set city = @city1
where ISNULL(city);
SELECT * FROM temperatures;

