February 2018
Intermediate to advanced
510 pages
16h 10m
English
A NULL value is often a point of confusion for new programmers. The NULL value is by mistake interpreted as an empty string '' in the case of strings. This is not correct. The following is an example of completely different statements:
mysql> INSERT INTO my_table (phone) VALUES (NULL); mysql> INSERT INTO my_table (phone) VALUES ('');
In the preceding example, both statements insert the value in the same column (phone column). The first statement inserts a NULL value, whereas the second statement inserts an empty string. The first value can be considered as the phone number is not known, whereas the second value indicates the person is known to have no phone, and thus no phone number.
When a NULL value is compared ...
Read now
Unlock full access