2 ms·
In the broader DB theory context and not strictly Pandas, think of a `users` table with a `middle_name` column. There's a difference between `middle_name is nul
by kstrauser 2y ago
In the broader DB theory context and not strictly Pandas, think of a `users` table with a `middle_name` column. There's a difference between `middle_name is null` (we don't know whether they have a middle name or what it is if they do) and `middle_name = ''` (we know that they don't have a middle name).
In that case, `select * from users where middle_name is null` gives us a set of users to prod for missing information next time we talk to them. `...where middle_name = ''` gives us a list of people without a middle name, should we care.
Edit:
A related aside is that Django's ORM's handling of NULL gives me freaking hives. From https://docs.djangoproject.com/en/5.1/ref/models/fields/#null https://docs.djangoproject.com/en/5.1/ref/models/fields/#nul...:
> If a string-based field has null=True, that means it has two possible values for “no data”: NULL, and the empty string. In most cases, it’s redundant to have two possible values for “no data;” the Django convention is to use the empty string, not NULL.
I've been around numerous Django devs when they found out that other DBs and ORMs do not remotely consider NULL and empty string to be the same thing.
- emmelaich 2y agoIn Oracle, "" is converted to NULL so maybe that's where they get that from.
- kstrauser 2y agoWhoa, you're right.[0] I wouldn't have expected that at all. [0] https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/Nulls.html#GUID-B0BA4751-9D88-426A-84AD-BCDBD5584071 https://docs.oracle.com/en/database/oracle/oracle-database/1...
- rbanffy 2y agoYou can almost count on Oracle doing the wrong thing… It never ceases to amaze me they got themselves into a position where they had to introduce a VARCHAR2 type.