Re: erd to db

From: Yves Guerin <yves.guerin_at_muhc.mcgill.ca>
Date: Fri, 22 Mar 2002 13:49:07 GMT
Message-ID: <nDGm8.10802$R8.275980_at_carnaval.risq.qc.ca>


Hello,

Thank you for your help. In fact I am coding a software to do the mapping from Dia (ER) (http://www.lysator.liu.se/~alla/dia/) to postgreSQL (SQL statement to create my tables) and I try to find out the method or the concept behind the Dia ER plugin. I used to play with Merisse ER, and I try to find on the Internet the concept of mapping ER to relational database without a true success (the explanation depends of the writer, so I get many different versions).

Regards

Yves

--
Yves Guerin
CUSM-MUHC
Groupe Interfaces
Montreal - Canada
"Jan Hidders" <hidders_at_uia.ua.ac.be> wrote in message
news:3c9af4b6$1_at_news.uia.ac.be...

> "Yves Guerin" <yves.guerin_at_muhc.mcgill.ca> wrote in message
> news:bxpm8.7127$R8.88795_at_carnaval.risq.qc.ca...
> >
> > I have question about to map a erd to a ralational database:
> >
> > I have the following entities: E and W in binary ERD
> > E: owner of W
> > W: weak
> > E: primary key is e1
> > W: primary key is w1
> > The relationship between E and W is R and R has a primary key: r1
>
> I'm not sure what type of ERDs you are talking about, but in the usual
ones
> your problem statement doesn't make sense. First, if W has a primary key
> then it is by definition not a weak entity, and second, there can be no
such
> thing as the primary key of a relationship other than that which is
implied
> by the involved entity types (if there would be then it is not a
> relationship but an entity type).
>
> So it should have been:
>
> An entity type E with primary key e.
> A weak entity type W with a partial key w.
> A weak relationship R between E and W.
>
> The usual way to implement this is to introduce a table for E with primary
> key e, and a table for W with primary key e + w. Note that you don't need
a
> table for W.
>
> -- Jan Hidders
>
>
Received on Fri Mar 22 2002 - 14:49:07 CET

Original text of this message