What is a Null?
and how does it differ from integer zero?
What do we mean by "null" and how is it different to the
ordinal 0?
An example of null is the empty set { }. This means the absence of any
value or "nothing".
Example 1:
We are planning a party and need to find out how many guests our
friends are bringing. We start to make a list:
| Friend |
|
Guests |
|
| Steve |
|
|
| Albert |
|
|
| Terry |
|
|
At this point there are no values in the "Guests" column. The
values are empty or "null". Until we ascertain how many guests
each of our friends is bringing, there are no numbers at all. This is
different than having an integer number of guests each.
Example 2:
Take a calculator, enter "1" then "/". Do not enter
anything else.
This is what happens when dividing by null. There is nothing to divide
by and the result is null, or nothing.
Example 3:
You have 2 apples. I take them both. You don't have zero apples. You
have nothing.
The rules for Null we use in this article are essentially the same as
the American National Standards Institute (ANSI) SQL rules for Nulls,
except we use zero quantities and null interchangeably. These rules can be
summarised as "null is not a number and doesn't take part in any
mathematical operations".
|