Re: erd to db
Date: Fri, 22 Mar 2002 20:10:27 GMT
Message-ID: <TcMm8.8$3B.988_at_petpeeve.ziplink.net>
Yves,
I can't give you any help, but I can point you at a product that does what
you propose to do.
Studying that product, or conversing with its users, could conceivable help
you.
The product is "Data Architect", part of the "Power Designer" suite from Sybase.
DA maintains three kinds of models: A conceptual data model, a physical data model, and an object oriented model. You can convert any kind of model into either of the other two kinds.
The conceptual data model is an ER model, with a few features thrown in that were new to me. These new features may have been added to the ER model while I was not paying attention, or they may have been added by Sybase for just this product. But they are relatively small additions to the fundamental ER model.
The physical data model is, in essence, a database design. It can be used to produce the SQL DDL that will generate the database objects. It includes what I'll call the "logical data model", that is the definition of columns, and their grouping in to tables, and into index keys, and a few other things, like constraints and logical keys. The logical data model is relational.
When a user selects a conceptual data model, and uses it to generate a physical data model, most of the work done is precisely what you are talking about: creating entity tables, and creating relationship tables under certain circumstances, and filling in foreign keys.
This isn't any direct help, Yves, but you may be able to use this info to find out a little of what you need.
-- Regards, David Cressey www.dcressey.com "Yves Guerin" <yves.guerin_at_muhc.mcgill.ca> wrote in message news:nDGm8.10802$R8.275980_at_carnaval.risq.qc.ca...Received on Fri Mar 22 2002 - 21:10:27 CET
> 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
> >
> >
>
>