0

I got confused when someone spoke of relational models when I asked a question about EER models. I've learned about the difference between ER and EER diagrams, but I'd like to understand the whole modelling process... I know EER are enhanced ER models, i.e. ER models with specialization/generalization.

When someone says ER modelling does he also imply EER modelling?

And what about database normalization? Does that only apply to relational diagrams?

user1534664
  • 3,258
  • 8
  • 40
  • 66

1 Answers1

7

The ER model was originally introduced in 1976 by Peter Chen, although it was influenced by earlier work. In the early 1980s it was almost exclusively used to model data at the conceptual level, where its principal value was that it was unbiased with regard to implementation. While it was, and remains, very easy to convert an ER model into a relational model, the ER model has also been seen as useful in some cases where the final implementation was to be some kind of pre-relational DBMS like IMS. It has also been used in a preliminary stage in projects where the final implementation was to be in some kind of unstructured or post-relational DBMS, or an Object Database.

A great many practitioners merge ER modeling and relational modeling, and come up with a single model that serves both purposes. While the two models have a lot of overlap, the differences are important enough so that merging the two of them waters them both down. This merging is most visible when it comes to ER diagrams. Many, perhaps most, of the so called ER diagrams are really relational models, even if they use ER diagramming conventions.

In the Wikipedia article on ER, it mentions the classic three layers: conceptual, logical, and physical, and treats them as all variants on the ER model. That's not how it was in the 1980s. The ER model was conceptual. The logical model was relational, provided the final target was to be a relational database. The physical level was DBMS specific, and tried to meet performance and volume goals as well as the more abstract goals of the logical and conceptual levels.

All this may be ancient history, or even pre-history in the world of IT, which is forever young.

The biggest differences are that foreign keys are not present in an ER model. Relationships are visible in an ER model, but ER is silent on how they are to be implemented. Foreign keys are just one way to implement relationships. In a relational database, they are the only way that makes sense. ER also models many-to-many relationships directly, without putting another entity in the middle. Relational models require an intermediate table (often called a "junction box") to hold two foreign keys that implement the many-to-many relationship.

The enhancements that are included in the EER consist mainly in adding gen-spec (superclass/subclass) and unions to the modelling conventions. These are nearly universally part of ER by now, so the term EER is really a historical accident.

Normalization as originally developed is properly part of relational database design. It can't really be applied in non-relational situations, without substantially messing around with the normal forms (1NF through 5NF and DKNF). Properly speaking, normalization is irrelevant in ER modeling. However, there is a modelling error that's easy to make In ER modelling that almost always correlates with normalization errors at the logical level: it's associating an attribute with the wrong entity, or conflating two distinct attributes into a single one.

I could go on, but this is already too long.

Walter Mitty
  • 18,205
  • 2
  • 28
  • 58
  • Thanks, this really cleared some confusion. I get the impression you still look at these concepts the way they were in 1980, i.e. ER model = conceptual, relational model = logical, physical = RDBMS specific. Do you recommend me to still look at it this way, or should I go with wikipedia, viewing the ER model as a superset of conceptual, logical and physical schema's? – user1534664 Sep 13 '14 at 12:46
  • Let me ask a similar question as my previous comment: If my textbook has an assignment where it says, "Create an ERD that models this business scenario", would it mean they want me to create a conceptual or a logical model? Also, let me just say this once, I can't stress how thankful I am. You answered my 4 previous questions about ERD's as well. I'm finally starting to understand the big picture of database modelling thanks to you and hours of my time trying to understand wikipedia :) – user1534664 Sep 13 '14 at 13:26
  • 1
    I still think the way I thought concerning conceptual, logical, and physical. And I no longer build databases professionally. I'll leave it to others to make recommendations about whether to follow wikipedia's lead in this regard. One thing I will definitely recommend. Learn the difference between analysis and design, if you haven't already learned it. And spend an appropriate amount of time analyzing a problem before you try to come up with a solution. This is something that most IT professionals have to learn the hard way, and many have to learn more than once. – Walter Mitty Sep 13 '14 at 13:40
  • I can't tell you whether your teacher wants you to produce an ER model at the conceptual level or the logical level, or even whether your teacher is asking for you to analyze the problem or to design the solution. You'll just have to ask your teacher. – Walter Mitty Sep 13 '14 at 13:43
  • old one - anyway: I never thought it is relevant how the relation is presented or implemented, as long as all readers understand the relation is a relation. However thanks for raising the awareness and to enable me to judge and name my behaviour consciusly. – Quicker Sep 06 '18 at 13:31
  • It depends. Relevant to whom? The enterprise stakeholders in the data are concerned with the conceptual model, and whether it's consistent with the business model. The programmers are concerned with the logical model, and whether it's consistent with their storage and retrieval operations (DML). The DBA is concerned with the physical model and whether it's consistent with the actual database. – Walter Mitty Sep 06 '18 at 14:56