What Happens If NULL Values Are Involved in Expressions?
Submitted by: AdministratorIf NULL values are used in expressions, the resulting values will be NULL values. In other words:
► Arithmetic expressions with NULL values result NULL values.
► Comparison expressions with NULL values result NULL values.
► Logical expressions with NULL values result NULL values.
The tutorial exercise shows you some interesting examples:
SELECT NULL + NULL FROM DUAL;
NULL
SELECT NULL + 7 FROM DUAL;
NULL
SELECT NULL * 7 FROM DUAL;
NULL
SELECT NULL = NULL FROM DUAL;
NULL
SELECT 0 < NULL FROM DUAL;
NULL
SELECT '' > NULL FROM DUAL;
NULL
SELECT NULL AND TRUE FROM DUAL;
NULL
SELECT NULL OR TRUE FROM DUAL;
1
-- This is contradicting against the rules!
Submitted by: Administrator
► Arithmetic expressions with NULL values result NULL values.
► Comparison expressions with NULL values result NULL values.
► Logical expressions with NULL values result NULL values.
The tutorial exercise shows you some interesting examples:
SELECT NULL + NULL FROM DUAL;
NULL
SELECT NULL + 7 FROM DUAL;
NULL
SELECT NULL * 7 FROM DUAL;
NULL
SELECT NULL = NULL FROM DUAL;
NULL
SELECT 0 < NULL FROM DUAL;
NULL
SELECT '' > NULL FROM DUAL;
NULL
SELECT NULL AND TRUE FROM DUAL;
NULL
SELECT NULL OR TRUE FROM DUAL;
1
-- This is contradicting against the rules!
Submitted by: Administrator
Read Online MySQL Programming Job Interview Questions And Answers
Top MySQL Programming Questions
☺ | What Is TIMESTAMP in MySQL? |
☺ | How To Use Regular Expression in Pattern Match Conditions? |
☺ | How To Write Date and Time Literals? |
☺ | How To Use CASE Expression? |
☺ | How To Decrement Dates by 1 in MySQL? |
Top Databases Programming Categories
☺ | RDBMS Interview Questions. |
☺ | SQL Interview Questions. |
☺ | SSRS Interview Questions. |
☺ | Database Administrator (DBA) Interview Questions. |
☺ | Sybase Interview Questions. |