Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

10
  • 1
    Saying null is not a value (whatever that means) or that it is a marker (whatever that means) just promotes confusion & imprecision & is an impediment to clear thinking. Null is a value treated in a certain way by SQL syntax & operators. In "everyday mathematics or logic" anything can be a value, and null is a structureless everyday boring one like 7. Commented Jun 8, 2020 at 7:19
  • 1
    In standard SQL a uniqueness constraint does not enforce uniqueness if any column permits nulls. - see the thread following the question - apparently, the standard does not say this - multiple nulls are allowed for UNIQUE constraints! The thing everybody agrees on is that a NULL cannot be part of a PRIMARY KEY! Commented Jun 8, 2020 at 10:35
  • @Vérace "multiple nulls are allowed" is correct. That's what I mean when I say that uniqueness is not enforced. It's possible to have duplicate rows if you allow nulls so the rows won't necessarily be unique in the case of a nullable UNIQUE constraint. Commented Jun 8, 2020 at 17:33
  • @philipxy, Don't all values have the property of being equal to themselves? x=x is true if x is 7 but not if x is a null. Don't all values have the property of being not equal to other values? x='x is false if x is 7 but not if x is a null. Commented Jun 8, 2020 at 17:39
  • 1
    SQL = is not equals on scalars. It's like equals but it treats null differently. SQL is not distinct from is equals on scalars. Commented Jun 8, 2020 at 17:49