----- Original Message ----- 
  From: vijaya raj 
  To: Rhino 
  Sent: Monday, August 02, 2004 9:31 AM
  Subject: Re: help-in-normalizing


  dear rhino and whil
  thanks for that valuable tip.
  but, dont i have to wory about the repeating id's (are they not redundant...) in 
this table, excuse me if this query looks silly...

  PLANT_MOLECULE
  plant_id    molecule_id    quantity
  ---------    --------------    --------
  1             A                    3.0E12
  1             D                    4.7E09
  2             D                    2.1E05
  2             B                    9.8E22
  2             C                    0.8E08
  3             E                    0.1E31
  3             D                    6.2E03

First of all, this is a table, not a query. 

There is no duplication in the table either.  Although various plant_ids and 
molecule_ids appear several times in the table, each row represents one COMBINATION of 
plant_id and molecule_id. In other words, plant_id 3, contains two molecules, E and D. 
Although the other plants also contain molecule D, as well as other molecules, this 
does not affect plant_id 3, as long as the primary key of plant_molecule is the 
COMBINATION of plant_id and molecule_id. 

Remember, if the primary key contains both the plant_id and the molecule_id, the table 
will allow only one occurrence of a given combination of plant_id and molecule_id and 
you will never be able to get two or more rows that have the plant_id 3 / molecule_id 
D combination.  

Don't let the quantity column bother you too much; I only mentioned it because 
sometimes you need to have additional information about the combination of plant_id 
and molecule_id, such as the number of molecules per gram of a specific plant. 
(Actually, you probably don't care how many grams of molecules occur in a given plant: 
I was just trying to come up with an example to illustrate how such a quantity should 
be added to your design.) You may never need any additional column in the 
plant_molecule table beyond the plant_id and molecule_id columns so just ignore the 
quantity column altogether unless you need something like that.

Rhino

Reply via email to