4 ms·
Null dates and null numbers are sometimes useful. Null strings? No. It basically never makes sense to distinguish between text/varchar '' and NULL. If you reall
by earthboundkid 7y ago
Null dates and null numbers are sometimes useful. Null strings? No. It basically never makes sense to distinguish between text/varchar '' and NULL. If you really need to distinguish between "no middle name" and "middle name not provided" (why would you need that?), just add a boolean middle_name_known. NULL creeps into data in all sorts of ways, so you can't trust that the people doing your entry are actually using the semantics you want for null text. Add a boolean field and make them explicitly commit to the semantics.
- cavanasm 7y agoCame here for this. I've had so many struggles with big enterprise data where engineers who design the schema think empty strings and nulls should have meaningful distinctions, but the humans involved in creating that data (who are not engineers) somehow break those assumptions, so when the data migrated elsewhere, inevitably it gets collapsed back down to null and empty string being identical.