← Back to context

Comment by MrMcCall

2 days ago

  6. ensure there are no nulls in firstname and lastname
  7. alter the columns to be NOT NULL

Because no non-statistician uses nullable columns, right?

Of course, some dbs (SQLServer?) infer NULL from the empty string, or am I misremembering?

Always having the columns be NOT NULL is a fundamental cheat, after always having a PK, or is that too old school for 2025?

There's nothing wrong with nullable fields when it's appropriate. When kids are born they don't have names. Not all users want to tell you their names. A null value is data too.

  • > when it's appropriate

    Yes, it just requires extra care when querying and handling the rows.

    It's always just easier, if you can, to make it NOT NULL after prepopulating all rows' columns to the empty string (or real data).

    Sometimes NULL is truly different than the empty string, but that, like you said, is just a kind of data.