Re: NULL values or Zero in numeric fields?

From: Tuan Nguyen <nvtuan_at_deepthnk.kiwi.gen.nz>
Date: 1995/12/05
Message-ID: <2335571934.32415823_at_deepthnk.kiwi.gen.nz>#1/1


Francois Lachance,francois.lachance_at_sasknet.sk.ca,News Only wrote: <<We have a few tables with numeric columns. By default, if you don't save a value in those columns, they are NULL values. Is there an advantage to leaving these empty rows as NULL? Users that are doing queries directly against the database are asking that Zero be put in the rows where no value has been specified. Programmers find it annoying to have to make sure that calculations are not done on NULL values since it returns a NULL if you do.

What does that do as far as data storage is concerned? Will a zero take more space then a NULL?

Thanks for any help that you can provide.>>

It is quite important to be able to tell whether a column - be it of numeric or character type - has a value (not NULL) or not (NULL). If you decide to put a value of zero (0) into a column by default, then you may have destroyed a meanigful bit of information, namely that no value was actually provided for that column. On the other hand, you may not give a damn! Data storage is not a consideration.

Cheers

  • Tuan _/_/_/ _/_/_/_/ Tuan Nguyen _/ _/ _/ Deep Thought BBS, Auckland, New Zealand _/ _/ _/ A FirstClass(tm) Macintosh GUI BBS _/_/_/ _/ Internet: nvtuan_at_deepthnk.kiwi.gen.nz tnguyen_at_continuum.co.nz Praised be the fathomless Universe for Life and Joy.
Received on Tue Dec 05 1995 - 00:00:00 CET

Original text of this message