Re: Object-oriented thinking in SQL context?

From: none <rp_at_raampje.>
Date: 09 Jun 2009 22:41:37 GMT
Message-ID: <4a2ee521$0$24893$703f8584_at_news.kpn.nl>


Bernard Peek replies:

>>An ER diagram is a representation of the relations (tables)
>>and foreign key relationships in a relational database schema.
>
>That's the physical data structure which describes the way the database
>has been built. That's often derived from the logical (and sometimes a
>separate conceptual) data structure. That's where the objects on the
>diagrams are entities. Entities and tables are not the same thing.

They are the same thing regarded at a different level of abstraction and a different level or detail. They do map to each other. Every ER diagram maps to a relational schema after certain transformation steps, and many relational schemas map to ER diagrams of a particular type.

>The ERD is an entity relationship diagram which details the logical or
>conceptual structure which is then used as a basis for a physical
>design.

I thought that's what I wrote, in different words.

>Entities loosely map to classes in that there are instances of each
>entity which vaguely map to objects as instances of a class.

Yes, for 'entity-like' classes.

>One thing to be aware of is that different design methodologies use
>entities and ERDs in slightly different ways. Some have the concept of a
>sub-entity, others don't.

Yes, is-a (specialization), if used, is one of the constructs that have to be transformed away, relational schemas don't support it.

-- 
Reinier
Received on Wed Jun 10 2009 - 00:41:37 CEST

Original text of this message