4 ms·
I remember having a realisation regarding null in SQL data models that is probably obvious to other people who paid attention to the "History of SQL" parts of t
by verytrivial 7y ago
I remember having a realisation regarding null in SQL data models that is probably obvious to other people who paid attention to the "History of SQL" parts of the lecture, but was along the lines that tables are sets, and all relations are sets, so where a relation has no value, you are really just talking about the empty set, and there is only one of those. i.e. You can remove all null "values" from your tables by normalising on that column -- null was just where the join is now empty. (But obviously don't actually do that, it was more a thought experiment for a null-less nirvana.)
- ben509 7y agoYup, you get it for free if you normalize to 6th normal form. As you indicated, it's not a great idea in SQL DBMS's. https://en.wikipedia.org/wiki/Sixth_normal_form https://en.wikipedia.org/wiki/Sixth_normal_form
- ben509 7y agoAlso, there is a QL that treats all values as sets, EdgeQL[1], and they get null for free. [1]: https://edgedb.com/docs/edgeql/overview#everything-is-a-set https://edgedb.com/docs/edgeql/overview#everything-is-a-set