Re: E/R modeling: relationship's attributes

From: Neo <neo55592_at_hotmail.com>
Date: 1 May 2006 10:11:47 -0700
Message-ID: <1146503507.747880.55680_at_u72g2000cwu.googlegroups.com>


> In Chen's Entity/relationship model, relationships too can have attributes.
> How should I represent these relationships in a database?

In dbd (Db for Dummies!), the below abridged script gives the relationship "like" an attribute that indicates its opposite is "hate". A query that utilizes this attribute is also shown.

(; Create various relationships)
(create like opposite hate)
(create john like mary)
(create john hate bob)

(; Find the thing with which john's relationship

   is opposite that to mary. Query returns bob.) (select john

          (select (select john * mary)
                     opposite
                     *)
          *)

While the equivalent is possible with RMDBs using generic modelling, it is not as general/flexible/systematic. Maybe someone in c.d.t can post a similar RMDB solution. Received on Mon May 01 2006 - 19:11:47 CEST

Original text of this message