• Obviously the article is posted by somebody who has no clue about database fundamental theory....The writer just made up the *Four Rules* to make it sound scientific but in fact, most of what's written is just a bunch of crappola...

    NULLS are the poorest possible way to handle missing data on any direct image system(SQL Server, ORACLE, DB2), which is why they should never be used in the first place. So the message which learn to use them is basically the same as saying: NULLS will mess up your database but here is how to make them less harmful. I say don't use them...

    Some proofs of the absurdity of using NULLS in SQL Server.

    First, let's create a simple table and fill it with data

    create table table1(field1 int, field2 int)

    go

    insert table1

    select 1, 1

    insert table1

    select 2, 1

    insert table1

    select 3, 2

    insert table1

    select 4, NULL

    The table has now

    field1 field2

    11

    21

    32

    4NULL

    Proof1:

    run this

    now run....

    select sum(field1 + field2) from table1

    --> it returns 10

    then run...

    select(field1) + sum(field2) from table1

    which should produce the same righ. Wrong!!

    --> it return 14 !

    So use of NULLS will mess up your sum results...

    Proof2:

    on the above table run this...

    select * table1 where field1 = field2

    according to the data, it returns all matching records between field1 and field2...The query returns

    field1 field2

    11

    Now run

    select * from table1 where field1 field2

    to return non matching records in column field1 and column of field2...Where on woulmd expect the three last records, the system returns

    field1 field2

    21

    32

    As you can see the system does consider that 4 = NULL a total onsense. 3VL will somebody say but 3VL does not apply in relational modeling. Only 2VL logic applies in Relation Model else it is nothing but relational.

    Proof3 (the proof that 3VL logic is nothing but bullshit):

    Based on the above Proofs how do we get the entire table?

    well basically,

    select * from table1

    is equivalent to

    select * from table1 where field1 = field2

    union

    select * from table1 where field1 field2

    union

    select * from table1 where field2 is null

    which total nonsense...and adds unecessary complexity

    select * from table1

    should indeed equal to

    select * from table1 where field1 = field2

    union

    select * from table1 where field1 field2

    why use a logic that breaks pretty much all prequisites that make a system relational, get exposed to false results unless putting tons of IS NULL/IS NOT NULL conditions that will degrade performance by additional index scans when one can do without them.