Hacker News new | ask | show | jobs
by mnsc 529 days ago
But in a _relational_ database lack of spouse would not be modeled with a nullable column "spouse" but rather an absence of a spouse row/relation. Which is very real-world-like.
2 comments

As a sort of challenge I had an idea of building an app using SQL as a pseudo ECS system where every table was either a 1 column table with only an id or a 2 column table with an id and a value.
And yet when you do a join because you need to actually use that data, the resulting table will have a column with nulls in it. Any way you squeeze it, you need a way to represent empty values for your database to be useful.
An inner join? Then there wouldn't be any nulls.
IDK, do you want to exclude people without a middle name or a second address line when examining a product order list? I'll leave that one for you to decide.