Re: DBDesign Q

From: Joe \ <joe_at_bftsi0.UUCP>
Date: Mon, 24 Nov 2003 11:21:51 -0800
Message-ID: <1069701707.142710_at_news-1.nethere.net>


"Andy" <net__space_at_hotmail.com> wrote in message <news:edb90340.0311232036.e0eeae5_at_posting.google.com>...

> Can two entities have more than one relationship between them?
>
> A(A_ID PK,..., bID FK)
>
> B(B_ID PK,..., aID FK)
>
> A.bID refers to B.B_ID
> B.aID refers to A_ID
>
> 2. Does it make sense?
>
> Product (ProductID PK, Name,., SpecialAttrID FK)
>
> Attribute (AttrID PK, Name,..,ProductID FK)
>
> Product can have many attributes. One attribute belongs to only one product.
> There is only one main("special") attribute for each product

Maybe you really want an "extender table" approach, in which the Product table holds attributes which all products have, and additional tables to hold attributes which some, but not all, products have, perhaps like so:

Product (ProductID PK, Name, Manufacturer, Price, Mass, Volume, ...)

Book (ProductID PK/FK, Author, Pages, Binding, ...)

Album (ProductID PK/FK, Artist, Tracks, Media, PlayingTime, ...)

Software (ProductID PK/FK, Platform, Media, ...)

--
Joe Foster <mailto:jlfoster%40znet.com>  "Regged" again? <http://www.xenu.net/>
WARNING: I cannot be held responsible for the above        They're   coming  to
because  my cats have  apparently  learned to type.        take me away, ha ha!
Received on Mon Nov 24 2003 - 20:21:51 CET

Original text of this message