![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What would be the result if we perform any kind of arithmetic calculations in MySQL having one of the arguments as NULL?
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.
Advertisements