I'm interested mainly in MySQL and PostgreSQL, but you could answer the following in general:
- Is there a logical scenario in which it would be useful to distinguish an empty string from NULL?
-
What would be the physical storage implications for storing an empty string as…
- NULL?
- Empty String?
- Another field?
- Any other way?
Best Answer
Let's say that the record comes from a form to gather name and address information. Line 2 of the address will typically be blank if the user doesn't live in apartment. An empty string in this case is perfectly valid. I tend to prefer to use NULL to mean that the value is unknown or not given.
I don't believe the physical storage difference is worth worrying about in practice. As database administrators, we have much bigger fish to fry!