- 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 output if we use a NULL value in an arithmetic expression?
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.
Advertisements
To Continue Learning Please Login
Login with Google