1 / 70

Entity Relationship Modeling in Database Design

Learn the main characteristics of entity relationship components, how relationships between entities are defined and refined, and how ERD components affect database design and implementation. This chapter also explores the reconciliation of conflicting goals in real-world database design.

rachelm
Download Presentation

Entity Relationship Modeling in Database Design

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 4 Entity Relationship (ER) Modeling Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel

  2. In this chapter, you will learn: • The main characteristics of entity relationship components • How relationships between entities are defined and refined and how those relationships are incorporated into the database design process • How ERD components affect database design and implementation • That real-world database design often requires the reconciliation of conflicting goals Database Systems: Design, Implementation, & Management, 7th Edition, Rob & Coronel

  3. The Entity Relationship (ER) Model • ER model forms the basis of an ER diagram • ERD represents conceptual database as viewed by end user • ERDs depict database’s main components: • Entities • Attributes • Relationships Database Systems: Design, Implementation, & Management, 7th Edition, Rob & Coronel

  4. Entities • Refers to entity set and not to single entity occurrence • Corresponds to table and not to row in relational environment • In both Chen and Crow’s Foot models, entity is represented by rectangle containing entity’s name • Entity name, a noun, is usually written in capital letters Database Systems: Design, Implementation, & Management, 7th Edition, Rob & Coronel

  5. Attributes • Characteristics of entities • In Chen model, attributes are represented by ovals and are connected to entity rectangle with a line • Each oval contains the name of attribute it represents • In Crow’s Foot model, attributes are written in attribute box below entity rectangle Database Systems: Design, Implementation, & Management, 7th Edition, Rob & Coronel

  6. Attributes (continued) Database Systems: Design, Implementation, & Management, 7th Edition, Rob & Coronel

  7. Domains • Attributes have domain • Domain is attribute’s set of possible values • Attributes may share a domain Database Systems: Design, Implementation, & Management, 7th Edition, Rob & Coronel

  8. Identifiers (Primary Keys) • Underlined in the ERD • Key attributes are also underlined in frequently used table structure shorthand Database Systems: Design, Implementation, & Management, 7th Edition, Rob & Coronel

  9. Composite Primary Keys • Primary keys ideally composed of only single attribute • Possible to use a composite key • Primary key composed of more than one attribute Database Systems: Design, Implementation, & Management, 7th Edition, Rob & Coronel

  10. Composite Primary Keys (continued) Database Systems: Design, Implementation, & Management, 7th Edition, Rob & Coronel

  11. Composite and Simple Attributes • Composite attribute can be subdivided • Simple attribute cannot be subdivided Database Systems: Design, Implementation, & Management, 7th Edition, Rob & Coronel

  12. Single-Valued Attributes • Single-value attribute can have only a single value Database Systems: Design, Implementation, & Management, 7th Edition, Rob & Coronel

  13. Multivalued Attributes • Multivalued attributes can have many values Database Systems: Design, Implementation, & Management, 7th Edition, Rob & Coronel

  14. Multivalued Attributes (continued) Database Systems: Design, Implementation, & Management, 7th Edition, Rob & Coronel

  15. Resolving Multivalued Attribute Problems • Although conceptual model can handle M:N relationships and multivalued attributes, you should not implement them in relational DBMS • Within original entity, create several new attributes, one for each of the original multivalued attribute’s components • Can lead to major structural problems in table • Create new entity composed of original multivalued attribute’s components Database Systems: Design, Implementation, & Management, 7th Edition, Rob & Coronel

  16. Resolving Multivalued Attribute Problems (continued) Database Systems: Design, Implementation, & Management, 7th Edition, Rob & Coronel

  17. Resolving Multivalued Attribute Problems (continued) Database Systems: Design, Implementation, & Management, 7th Edition, Rob & Coronel

  18. Resolving Multivalued Attribute Problems (continued) Database Systems: Design, Implementation, & Management, 7th Edition, Rob & Coronel

  19. Derived Attributes • Attribute whose value may be calculated (derived) from other attributes • Need not be physically stored within database • Can be derived by using an algorithm Database Systems: Design, Implementation, & Management, 7th Edition, Rob & Coronel

  20. Derived Attributes (continued) Database Systems: Design, Implementation, & Management, 7th Edition, Rob & Coronel

  21. Derived Attributes (continued) Database Systems: Design, Implementation, & Management, 7th Edition, Rob & Coronel

  22. Relationships • Association between entities • Participants are entities that participate in a relationship • Relationships between entities always operate in both directions • Relationship can be classified as 1:M, 1:1, M:N • Relationship classification is difficult to establish if know only one side of the relationship Database Systems: Design, Implementation, & Management, 7th Edition, Rob & Coronel

  23. Connectivity and Cardinality • Connectivity • Used to describe the relationship classification • Cardinality • Expresses minimum and maximum number of entity occurrences associated with one occurrence of related entity • Established by very concise statements known as business rules Database Systems: Design, Implementation, & Management, 7th Edition, Rob & Coronel

  24. Connectivity and Cardinality (continued) Database Systems: Design, Implementation, & Management, 7th Edition, Rob & Coronel

  25. Existence Dependence • Existence dependence • Exist in database only when it is associated with another related entity occurrence • Existence independence • Entity can exist apart from one or more related entities • Sometimes refers to such an entity as strong or regular entity Database Systems: Design, Implementation, & Management, 7th Edition, Rob & Coronel

  26. Relationship Strength • Weak (non-identifying) relationships • Exists if PK of related entity does not contain PK component of parent entity • Strong (Identifying) Relationships • Exists when PK of related entity contains PK component of parent entity Database Systems: Design, Implementation, & Management, 7th Edition, Rob & Coronel

  27. Weak (Non-Identifying) Relationships Database Systems: Design, Implementation, & Management, 7th Edition, Rob & Coronel

  28. Weak (Non-Identifying) Relationships (continued) COURSE Database Systems: Design, Implementation, & Management, 7th Edition, Rob & Coronel

  29. Strong (Identifying) Relationships Database Systems: Design, Implementation, & Management, 7th Edition, Rob & Coronel

  30. Weak Entities • Weak entity meets two conditions • Existence-dependent • Cannot exist without entity with which it has a relationship • Has primary key that is partially or totally derived from parent entity in relationship • Database designer usually determines whether an entity can be described as weak based on business rules Database Systems: Design, Implementation, & Management, 7th Edition, Rob & Coronel

  31. Weak Entities (continued) Database Systems: Design, Implementation, & Management, 7th Edition, Rob & Coronel

  32. Weak Entities (continued) EMPLOYEE DEPENDENT Database Systems: Design, Implementation, & Management, 7th Edition, Rob & Coronel

  33. Relationship Participation • Optional participation • One entity occurrence does not require corresponding entity occurrence in particular relationship • Mandatory participation • One entity occurrence requires corresponding entity occurrence in particular relationship Database Systems: Design, Implementation, & Management, 7th Edition, Rob & Coronel

  34. Relationship Participation (continued) Database Systems: Design, Implementation, & Management, 7th Edition, Rob & Coronel

  35. Relationship Participation (continued) Database Systems: Design, Implementation, & Management, 7th Edition, Rob & Coronel

  36. Relationship Participation (continued) Database Systems: Design, Implementation, & Management, 7th Edition, Rob & Coronel

  37. Relationship Participation (continued) Database Systems: Design, Implementation, & Management, 7th Edition, Rob & Coronel

  38. Relationship Degree • Indicates number of entities or participants associated with a relationship • Unary relationship • Association is maintained within single entity • Binary relationship • Two entities are associated • Ternary relationship • Three entities are associated Database Systems: Design, Implementation, & Management, 7th Edition, Rob & Coronel

  39. Relationship Degree (continued) Database Systems: Design, Implementation, & Management, 7th Edition, Rob & Coronel

  40. Relationship Degree (continued) Database Systems: Design, Implementation, & Management, 7th Edition, Rob & Coronel

  41. Recursive Relationships • Relationship can exist between occurrences of the same entity set • Naturally found within unary relationship Database Systems: Design, Implementation, & Management, 7th Edition, Rob & Coronel

  42. Recursive Relationships (continued) Database Systems: Design, Implementation, & Management, 7th Edition, Rob & Coronel

  43. Recursive Relationships (continued) Database Systems: Design, Implementation, & Management, 7th Edition, Rob & Coronel

  44. Recursive Relationships (continued) Database Systems: Design, Implementation, & Management, 7th Edition, Rob & Coronel

  45. Recursive Relationships (continued) Database Systems: Design, Implementation, & Management, 7th Edition, Rob & Coronel

  46. Recursive Relationships (continued) Database Systems: Design, Implementation, & Management, 7th Edition, Rob & Coronel

  47. Recursive Relationships (continued) Database Systems: Design, Implementation, & Management, 7th Edition, Rob & Coronel

  48. Composite Entities • Also known as bridge entities • Composed of primary keys of each of the entities to be connected • May also contain additional attributes that play no role in connective process Database Systems: Design, Implementation, & Management, 7th Edition, Rob & Coronel

  49. Composite Entities (continued) Database Systems: Design, Implementation, & Management, 7th Edition, Rob & Coronel

  50. Composite Entities (continued) Database Systems: Design, Implementation, & Management, 7th Edition, Rob & Coronel

More Related