You are right with the first part : Table 1 = Fruits then create a second
table e.g FruitRelationships , this would have at least 2 columns :
Fruit_id1 , Fruit_id2
you could then add as many relationshipts as you require. So if you need to
change the spelling of the fruit , you change it in the Fruits table , if
you
need to change the relationships , you change in FruitRelationships
--
Jack Vamvas
___________________________________
Search IT jobs from multiple sources-
http://www.ITjobfeed.com/mySQL
"-Lost" <maventheextrawords@techie.com> wrote in message
news:Xns99B42C7968146lostthreads@216.196.97.136...
> 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). Anyway, I am
> trying to understand the best way to implement this schema.
>
> Let's say the database is going to store fruit. Each fruit can also
> contain another fruit.
>
> So, without repeating and if I understand normalization correctly, I
> need 1 table to contain fruits and a fruit_id. Another table would
> contain fruit_id, and <I am lost at this point>. I understand the
> need to not repeat data, but I cannot seem to understand the logic
> behind it.
>
> How can I possibly store fruits that may contain other fruits,
> without repeating data such as the fruits themselves?
>
> For example:
>
> table: fruits
> id: 1
> fruit: grapes
> fruit_id: g1
>
> id: 2
> fruit: apples
> fruit_id: a1
>
> table: associated_fruits
> id: 1
> -- failure of 1NF (or is it?) if I put the fruit name here
> ?: ?
> fid: a1, g1
>
> So SOMETHING along these lines. I think I do not have enough
> experience to look at this without blurring the lines. I cannot see
> the woods because of the trees, so to speak.
>
> I also may not understand the first normal form. I am thinking 1NF
> pertains to one table, not 2 or more. Thereby my 2nd table *could*
> contain the fruit. Is this right?
>
> Sorry, if I explained this poorly, I have difficulties when it comes
> to logistics.
>
> Any ideas?
>
> Thanks!
>
> --
> -Lost
> Remove the extra words to reply by e-mail. Don't e-mail me. I am
> kidding. No I am not.