# What would be the output if we use a NULL value in an arithmetic expression?

MySQLMySQLi Database

#### MySQL Database Training for Beginners

39 Lectures 5.5 hours

#### Python programming with MySQL database: from Scratch

152 Lectures 16 hours

#### Learn MySQL from scratch for Data Science and Analytics

87 Lectures 5.5 hours

As we know that a NULL is no value and it is not the same as zero. MySQL represents a database column as NULL if it does not contain any data. Now, if we will use NULL in any arithmetic expression then the result will be NULL also.

## Example

mysql> Select 65/NULL,65+NULL,65*NULL,65-NULL,65%NULL;
+---------+---------+---------+---------+---------+
| 65/NULL | 65+NULL | 65*NULL | 65-NULL | 65%NULL |
+---------+---------+---------+---------+---------+
|    NULL |    NULL |    NULL |    NULL |    NULL |
+---------+---------+---------+---------+---------+
1 row in set (0.00 sec)

From the above example, it can be observed that if we will use NULL in an arithmetic expression then the result would be NULL itself.

Updated on 22-Jun-2020 10:58:08