Afficher un message
Vieux 23/09/2007, 10h38   #2
J.O. Aho
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Trying to wrap my brain around a normalization issue. Assistanceplease?

-Lost wrote:
> OK folks, please bear in mind I am a casual MySQL user, but not
> novice (at least I don't think so, I could be wrong).


Thats something I kind of think about myself too...

> table: fruits
> id: 1
> fruit: grapes
> fruit_id: g1
>
> id: 2
> fruit: applesthe
> fruit_id: a1


It feels a bit like you have two id's for each fruit, you could drop one
of the id's if they aren't used in another association.


> table: associated_fruits
> id: 1
> -- failure of 1NF (or is it?) if I put the fruit name here
> ?: ?
> fid: a1, g1


Just use the id's, you have the rest of the data in the fruits table and
yes it would go against the optimal normalization (4th NF).

Of course you should also take a look at what data you frequently need
to fetch and you do not want to need to join too many tables, in some
cases you can gain a little bit speed by not make the optimal normalization.

--

//Aho
  Réponse avec citation
 
Page generated in 0,07061 seconds with 9 queries