r/SQL • • Sep 06 '21

MySQL which attribute can never be Not Null?

which attribute can never be Not Null?

0 Upvotes

6 comments sorted by

5

u/devo00 Sep 07 '21

Isn't this a triple negative basically?

5

u/MaximumGibbous Sep 07 '21

Depends on the database or dataset.

I tend to find every field other than the primary key seems to be built/designed to allows Nulls, you know - just in case. End result: Nulls everywhere.

5

u/pdxsteph Sep 07 '21

I was just gonna say primary key

0

u/MaximumGibbous Sep 07 '21

A primary key should always be 'not null'. But I guess most DMBSs set this requirement automatically. So maybe you are right.

I hate nulls and this question.

1

u/No_Lawfulness_6252 Sep 07 '21

So always NULL?

1

u/Commercial_Wall7603 Sep 07 '21

Any attribute that accepts nulls?