A NULL value indicates an unknown value. A null value is different from a blank or zero value. No two null values are equal. Comparing two null values or comparing a null value to any other value returns unknown because each null value is unknown.
When writing data, the empty string '' is also a certain value, so it can be written even if you define NOT NULL.
If a column in a row has no value, then the column is said to be null, or to contain null. Nulls can appear in columns of any data type that are not restricted by NOT NULL or PRIMARY KEY integrity constraints. Use a null when the actual value is not known or when a value would not be meaningful. Oracle Database treats a character value with a length of zero as null. However, do not use null to represent a numeric value of zero, because they are not equivalent. Note: Oracle Database currently treats a character value with a length of zero as null. However, this may not continue to be true in future releases, and Oracle recommends that you do not treat empty strings the same as nulls. Any arithmetic expression containing a null always evaluates to null. For example, null added to 10 is null. In fact, all operators (except concatenation) return null when given a null operand.
A NULL value indicates an unknown value. A null value is different from a blank or zero value. No two null values are equal. Comparing two null values or comparing a null value to any other value returns unknown because each null value is unknown.
When writing data, the empty string '' is also a certain value, so it can be written even if you define NOT NULL.
NULL is a virgin
''Not a virgin, but currently single
The difference between NULL and empty value is basically the difference between 0 and "none".
In MySQL, for each field that is allowed to be NULL, mysql must reserve a bit of information for it (in each row) to mark whether it is NULL.
In the situation you mentioned:
NULL means unknown
An empty string represents a known empty
Please note that the exact meaning of NULL is "unknown" rather than "empty"
"" In fact, some people know. For example: For example, air actually exists, and NULL can be said to be a vacuum.
以下是摘自 Oracle SQL Reference 的内容,供你参考。版本是11g Release 2。
NULL is an uncertain content. A null value is equivalent to ""
The difference between null and '' is like a vacuum and a space with air. null means nothing in the pure sense, '' like a zero-length string.