Home arrow Development Cycles arrow Page 9 - Entity Relationship Modeling

Entity Relationship Modeling

Entity Relationship Modeling (ER modeling) is by far the most common way to express the analytical result of an early stage in the construction of a new database. In this ebook, Alf Pedersen describes the principles for ER modeling, as well as the most important terms used in modeling a new database.

Author Info:
By: Alf A. Pedersen
Rating: 4 stars4 stars4 stars4 stars4 stars / 90
April 05, 2004
  1. · Entity Relationship Modeling
  2. · The Entity
  3. · Other Business Contacts
  4. · Attributes in entities
  5. · Business Rules
  6. · Three types of relationships
  7. · Supplier Entity
  8. · A Weak Relation
  9. · A Useful Relation
  10. · Involuted (or recursive) relationships
  11. · Many-to-Many
  12. · The Database Analysis Team - A Teamwork
  13. · Level of Knowledge
  14. · Experience vs. Inexperience
  15. · Complete Model?
  16. · Building Queries
  17. · Other Common Errors in ER Modeling
  18. · Second Normal Violation
  19. · More Specific
  20. · Generic or Specific Models?
  21. · Analysts Experience

print this article

Entity Relationship Modeling - A Useful Relation
(Page 9 of 21 )

This is a very useful relationship: It implies what we call an "intersection entity", which will give an entity holding all legal combinations of orders and customers. This many-to-many relationship is much used in an early stage of analysis to indicate just that. This is such a useful relationship that I will evaluate it now. We return to the model of business contact and contact type we had earlier:

business contact

The way this is constructed, it only allows for a business to exist once. If we want a customer also to be a supplier, he must get a new contact id, and all information must be re-entered. We can (partly) solve it by making the primary key a combination of contact id and contact type:

business contacts

Note the vertical bar on the crow’s foot: It indicates that the relationship is part of the primary key in contact id. This is one of the most common errors being made in ER modeling.

This is a violation of the Second Normal Form. Name, telephone and entered date have nothing to do with contact type, only with business contact. We see that we are not able to properly represent the fact that a business contact may be a number of contact types. Here we can take full use of the many-to-many relationship capabilities:

business contact

This relationship says that a business contact MAY BE categorized as zero or more contact types, while a given contact type MAY BE a category for zero or more business contacts. This is total freedom. However, as stated earlier, we have no way of representing this in a physical database, and we have no way of taking care of all intersections in the ER model either, so we dissolve the relationship like this:

entity relationship

We may now read all rows in contact role to find out which roles a given business contact has towards our business.

Do not be afraid to use this construction. In my experience, it will always add flexibility into the finished analysis result.

blog comments powered by Disqus

- Division of Large Numbers
- Branch and Bound Algorithm Technique
- Dynamic Programming Algorithm Technique
- Genetic Algorithm Techniques
- Greedy Strategy as an Algorithm Technique
- Divide and Conquer Algorithm Technique
- The Backtracking Algorithm Technique
- More Pattern Matching Algorithms: B-M
- Pattern Matching Algorithms Demystified: KMP
- Coding Standards
- A Peek into the Future: Transactional Memory
- Learning About the Graph Construct using Gam...
- Learning About the Graph Construct using Gam...
- Learning About the Graph Construct using Gam...
- How to Strike a Match

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 

Developer Shed Affiliates


© 2003-2019 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials