Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> comp.databases.theory -> Re: So what's null then if it's not nothing?

Re: So what's null then if it's not nothing?

From: Alexandr Savinov <spam_at_conceptoriented.com>
Date: Wed, 23 Nov 2005 16:02:03 +0100
Message-ID: <4384847e$1@news.fhg.de>


Jon Heggland schrieb:
> In article <438456fe$1_at_news.fhg.de>, spam_at_conceptoriented.com says...
>

>>>You mean you would create a table for each *combination* of attributes? 
>>>What on earth for?
>>
>>In order to avoid nulls (there is an opinion that they need to be 
>>removed from schema).

>
>
> I get that part. But why one for each combination? Why not just one per
> attribute?

Yes, there are several alternative designs:

  1. For each combination of attributes. In this case each entity is guaranteed to be isolated (not distributed among many tables).
  2. One table for one attribute (as you propose). In this case one such table will store object ids for the objects (from the main table) that take this attribute (non-null) as well as its value. If the value of this attribute is absent then this table will not have a record for this object (physical deletion as opposed to NULL in a slot).
  3. A kind of EAV desingn. Here we store object-attribute-value triples. If an object does not have a value for an attribute then the corrosponding triple does not exist physically.

Probably there could be also other designs that allow us to avoid nulls. The above cases could be considered standard patterns while in general case we would mix them and apply in a generalized form.

-- 
http://conceptoriented.com
Received on Wed Nov 23 2005 - 09:02:03 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US