Archive for May, 2009|Monthly archive page

Some notes about null

Take a look at the examples:

The following are some practical issues related to what Mr. C.J. Date said about null. Let’s analyse the results in a couple of cases.Consider that we have a couple of attributes att1 and att2.

Case 1 (simple conditions in the example):

att1 = 3 and att2 = null

if we have the condition att1 = att2, the answer is the same as false. But, is the value 3 different from null?, not neccesarily, attibute att2 could be 3, then the correct answer should be unknown.

Case 2 (Intersect in the example):

The intersection of att1 = null in one table and the same att1 = null in the other table.

In this case of the Intersect, null is considered a value, that is why the intersection take place. But null is not a value is a symbol that represent unknown or some other meaning (soon an analysis of this aspect), that`s not correct, because the att1 value from one table  could or could not be the same as att1 from the other table.

A detailed explanation is found in my book:

Some SQL weaknesses explained in a video clip

In the following video clip from I explain a couple of the weaknnesses in a graphical way.