ButtonMoon
Registered User.
- Local time
- Today, 09:27
- Joined
- Jun 4, 2012
- Messages
- 304
I have commented on this FAQ article by The_Doc_Man before. Unfortunately I just came across another reference to it and so I'm making a plea to reason here: please, please correct this article (or preferably delete it!)
Here is an excerpt:
This is so completely wrong. In relational and SQL terms the empty set is a very different thing to null.
Brief digression: It's true that in the past the phrase "null set" was occasionally used by mathematicians as an alternative name for the empty set. That usage predates relational databases. "Null set" is a term very rarely used today and it has absolutely nothing to do with the database meaning of "null" which is quite different.
In Codd's relational model the empty set is not the same as null at all. x = x is TRUE if x is the empty set but if course x = x would not be true if x were null. In relational algebra the result of σ(1=0)R is an empty set (an empty relation), but the result would never be null. The empty set is a value (a set) which therefore must be distinct from null according to Codd's "Rule 3". Relational theory (and set theory for that matter) would be reduced to nonsense if the results of unions, intersections and joins returned nulls instead of the empty set.
The same is true in SQL and Access of course, where the empty set (the empty result of a query) is treated very differently from null. Null, by definition must be part of a non-empty result of a query.
The site's FAQ section is presented as a curated set of explanations of common questions, so it seems right to ask that these faults be cleared up.
Here is an excerpt:
... very specific - meaning of NULL in set theory. In the latter theory, NULL means the same thing as "empty set" - and it takes the same exact meaning whether you are doing simple sets, joined sets, unioned sets, or any other kind of set you can imagine. NULL = no members in the set. The population of the set is 0. More specifically for JOINS, it means that the INTERSECTION of the joining sets is empty.
This is so completely wrong. In relational and SQL terms the empty set is a very different thing to null.
Brief digression: It's true that in the past the phrase "null set" was occasionally used by mathematicians as an alternative name for the empty set. That usage predates relational databases. "Null set" is a term very rarely used today and it has absolutely nothing to do with the database meaning of "null" which is quite different.
In Codd's relational model the empty set is not the same as null at all. x = x is TRUE if x is the empty set but if course x = x would not be true if x were null. In relational algebra the result of σ(1=0)R is an empty set (an empty relation), but the result would never be null. The empty set is a value (a set) which therefore must be distinct from null according to Codd's "Rule 3". Relational theory (and set theory for that matter) would be reduced to nonsense if the results of unions, intersections and joins returned nulls instead of the empty set.
The same is true in SQL and Access of course, where the empty set (the empty result of a query) is treated very differently from null. Null, by definition must be part of a non-empty result of a query.
The site's FAQ section is presented as a curated set of explanations of common questions, so it seems right to ask that these faults be cleared up.