MySQL always throws NULL as the result of arithmetic calculations in which one of the arguments is NULL. Consider the following example having NULL as an argument with addition, subtraction, multiplication, and division −
mysql> Select 10*NULL; +---------+ | 10*NULL | +---------+ | NULL | +---------+ 1 row in set (0.12 sec) mysql> Select 10+NULL; +---------+ | 10+NULL | +---------+ | NULL | +---------+ 1 row in set (0.00 sec) mysql> Select 10-NULL; +---------+ | 10-NULL | +---------+ | NULL | +---------+ 1 row in set (0.07 sec) mysql> Select 10/NULL; +---------+ | 10/NULL | +---------+ | NULL | +---------+ 1 row in set (0.00 sec)
The output of all the arithmetic calculations above is NULL because of NULL as one of the arguments in it.