- Trending Categories
- Data Structure
- Operating System
- C Programming
- 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?
152 Lectures 16 hours
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.
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.
- While linking the strings, if I will add a NULL value then what would be the output of a CONCAT_WS() function?
- While linking two strings, if I will add a NULL value then what would be the output of a CONCAT() function?
- What would be the result if we perform any kind of arithmetic calculations in MySQL having one of the arguments as NULL?
- When a MySQL arithmetic expression returns NULL?
- What would be the output of MySQL ELT() function if the index number, provided as an argument, is not an integer?
- What would be the effect on MySQL output if we have the combination of NULL and other values in the list of strings, provided as arguments in FIELD() function?
- What would be output if we will try to extract time values by providing the date values only to MySQL EXTRACT() function?
- What is MySQL STRCMP() function and what would be the output of this function?
- What we can conclude if the final value in the NULL indicator is -2?
- What would be the output of MySQL SUM() function if a column having no values has been passed as its argument?
- What would be the five possessions if you are asked to keep?
- What MySQL would return if we refer a user variable which is not assigned any value explicitly?
- What would be the difference between default output format when running MySQL in batch mode or interactively?
- How an enumeration value in MySQL can be used in an expression?
- What would be the effect on the output of MySQL LAST_INSERT_ID() function in the case on multiple-row insert?