dbTalk Databases Forums  

NULLs

comp.databases.theory comp.databases.theory


Discuss NULLs in the comp.databases.theory forum.



Reply
 
Thread Tools Display Modes
  #331  
Old   
Sampo Syreeni
 
Posts: n/a

Default Re: NULLs - 01-08-2008 , 02:20 PM






On 2008-01-08, Hugo Kornelis wrote:

Quote:
But of course, all these real world applications and all these text
books still have to find some way to deal with missing information, so
they often introduce magic values (like -1 in a numeric domain that
should only allow positive numbers, 1900-01-01 or 9999-12-31 in a date
domain, 'N/A' in a string domain, etc). This then turns out to be a
far worse kludge than just using NULL for what it is intended to be
used for!
Yes, and actually I think this brings up a further reason why nulls are
often abused. There are many applications like open date ranges which
invite the database designer to utilize an existing data type -- in this
case a date -- which doesn't quite fit the job. After that you'd often
want to extend the datatype to include special values like "valid until
further notice". In typical DBMSes adding to the basic datatypes like
that is not easy, so the one special value that can be added easily,
null, gets overloaded. That is obviously bad, because unlike values
proper, null invokes 3VL semantics which now have to be circumvented
over and over in code, in order to mimic simple 2VL ones.

I think one means of relegating nulls to their proper place is to make
it easier to avoid them where missing information is actually not the
problem. That's then one reason why I think databases ought to have
stronger support for custom, abstract datatypes/domains, in an easy to
use form.
--
Sampo Syreeni, aka decoy - mailto:decoy (AT) iki (DOT) fi, tel:+358-50-5756111
student/math+cs/helsinki university, http://www.iki.fi/~decoy/front
openpgp: 050985C2/025E D175 ABE5 027C 9494 EEB0 E090 8BA9 0509 85C2


Reply With Quote
  #332  
Old   
Sampo Syreeni
 
Posts: n/a

Default Re: NULLs - 01-08-2008 , 02:20 PM






On 2008-01-08, Hugo Kornelis wrote:

Quote:
But of course, all these real world applications and all these text
books still have to find some way to deal with missing information, so
they often introduce magic values (like -1 in a numeric domain that
should only allow positive numbers, 1900-01-01 or 9999-12-31 in a date
domain, 'N/A' in a string domain, etc). This then turns out to be a
far worse kludge than just using NULL for what it is intended to be
used for!
Yes, and actually I think this brings up a further reason why nulls are
often abused. There are many applications like open date ranges which
invite the database designer to utilize an existing data type -- in this
case a date -- which doesn't quite fit the job. After that you'd often
want to extend the datatype to include special values like "valid until
further notice". In typical DBMSes adding to the basic datatypes like
that is not easy, so the one special value that can be added easily,
null, gets overloaded. That is obviously bad, because unlike values
proper, null invokes 3VL semantics which now have to be circumvented
over and over in code, in order to mimic simple 2VL ones.

I think one means of relegating nulls to their proper place is to make
it easier to avoid them where missing information is actually not the
problem. That's then one reason why I think databases ought to have
stronger support for custom, abstract datatypes/domains, in an easy to
use form.
--
Sampo Syreeni, aka decoy - mailto:decoy (AT) iki (DOT) fi, tel:+358-50-5756111
student/math+cs/helsinki university, http://www.iki.fi/~decoy/front
openpgp: 050985C2/025E D175 ABE5 027C 9494 EEB0 E090 8BA9 0509 85C2


Reply With Quote
  #333  
Old   
Sampo Syreeni
 
Posts: n/a

Default Re: NULLs - 01-08-2008 , 02:20 PM



On 2008-01-08, Hugo Kornelis wrote:

Quote:
But of course, all these real world applications and all these text
books still have to find some way to deal with missing information, so
they often introduce magic values (like -1 in a numeric domain that
should only allow positive numbers, 1900-01-01 or 9999-12-31 in a date
domain, 'N/A' in a string domain, etc). This then turns out to be a
far worse kludge than just using NULL for what it is intended to be
used for!
Yes, and actually I think this brings up a further reason why nulls are
often abused. There are many applications like open date ranges which
invite the database designer to utilize an existing data type -- in this
case a date -- which doesn't quite fit the job. After that you'd often
want to extend the datatype to include special values like "valid until
further notice". In typical DBMSes adding to the basic datatypes like
that is not easy, so the one special value that can be added easily,
null, gets overloaded. That is obviously bad, because unlike values
proper, null invokes 3VL semantics which now have to be circumvented
over and over in code, in order to mimic simple 2VL ones.

I think one means of relegating nulls to their proper place is to make
it easier to avoid them where missing information is actually not the
problem. That's then one reason why I think databases ought to have
stronger support for custom, abstract datatypes/domains, in an easy to
use form.
--
Sampo Syreeni, aka decoy - mailto:decoy (AT) iki (DOT) fi, tel:+358-50-5756111
student/math+cs/helsinki university, http://www.iki.fi/~decoy/front
openpgp: 050985C2/025E D175 ABE5 027C 9494 EEB0 E090 8BA9 0509 85C2


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.