1 / 34

Chapter 11 (I)

Chapter 11 (I). AIT632 Sungchul Hong. Chapter 11 - Objectives. How to use Entity–Relationship (ER) modelling in database design. Basic concepts associated with ER model. Diagrammatic technique for displaying ER model using Unified Modelling Language (UML).

Download Presentation

Chapter 11 (I)

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 11 (I) AIT632 Sungchul Hong

  2. Chapter 11 - Objectives • How to use Entity–Relationship (ER) modelling in database design. • Basic concepts associated with ER model. • Diagrammatic technique for displaying ER model using Unified Modelling Language (UML). • How to identify and resolve problems with ER models called connection traps. • How to build an ER model from a requirements specification.

  3. Entity-Relationship Model • ER modeling is a top-down approach to database design. • Unified Modeling Language • Create an ERD based on the user requirements.

  4. ER Diagram of Branch View of DreamHome

  5. Concepts of the ER Model • Entity types • Relationship types • Attributes

  6. Entity Type • Entity type • Group of objects with same properties, identified by enterprise as having an independent existence. • Entity occurrence • Uniquely identifiable object of an entity type.

  7. Entity Type & Entity Occurrence Employee Company

  8. Examples of Entity Types

  9. ER Diagram of Staff and Branch Entity Types

  10. Entities (Exercise) • A college is divided into several schools. • Each school is administered by a dean. • A dean is a professor • Each school is composed of several departments. • Each department offers several courses. • A course can have many sections • Each professor may teach up to four classes, each one a section of a course. A professor may also be on a research contract and teach no classes at all.

  11. Relationship Types • Relationship type • Set of meaningful associations among entity types. • Relationship occurrence • Uniquely identifiable association, which includes one occurrence from each participating entity type.

  12. Semantic Net of Has Relationship Type Branch has staff

  13. ER Diagram of Branch Has Staff Relationship

  14. Relationship Types • Degree of a Relationship • Number of participating entities in relationship. • Relationship of degree: • two is binary; • three is ternary; • four is quaternary.

  15. Binary Relationship called POwns

  16. Ternary Relationship called Registers

  17. Question • Can three binary relationships substitute a ternary relationship? (In general)

  18. Quaternary Relationship called Arranges

  19. Relationship Types • Recursive Relationship • Relationship type where same entity type participates more than once in different roles. • Relationships may be given role names to indicate purpose that each participating entity type plays in a relationship.

  20. Recursive Relationship called Supervises with Role Names

  21. Entities associated through two distinct Relationships with Role Names

  22. Attributes • Attribute • Property of an entity or a relationship type. • Attribute Domain • Set of allowable values for one or more attributes.

  23. Schema Instance

  24. Attributes • Simple Attribute • Attribute composed of a single component with an independent existence. • E.G.) SSN, salary • Composite Attribute • Attribute composed of multiple components, each with an independent existence. • E.g.) Name = {first, middle last}

  25. Attributes • Single-valued Attribute • Attribute that holds a single value for each occurrence of an entity type. • Multi-valued Attribute • Attribute that holds multiple values for each occurrence of an entity type. • E.g.) Telephone numbers

  26. Attributes • Derived Attribute • Attribute that represents a value that is derivable from value of a related attribute, or set of attributes, not necessarily in the same entity type. • E.G.) Total number of employee, Total salary

  27. CAR Registration(RegistrationNumber, State), VehicleID, Make, Model, Year, (Color) car1 ((ABC 123, TEXAS), TK629, Ford Mustang, convertible, 1999, (red, black)) car2 ((ABC 123, NEW YORK), WP9872, Nissan 300ZX, 2-door, 2002, (blue)) car3 ((VSY 720, TEXAS), TD729, Buick LeSabre, 4-door, 2003, (white, blue)) . . .

  28. Keys • Candidate Key • Minimal set of attributes that uniquely identifies each occurrence of an entity type. • Primary Key • Candidate key selected to uniquely identify each occurrence of an entity type. • Composite Key • A candidate key that consists of two or more attributes.

  29. Primary Key (Exercise) • staffNo, name, position salary, totalStaff • branchNo, address {street, city, zip code, telephone number[1..3]} • Patient number, patient name, drug number, drug name, description, dosage, method of admin, units per day, start date, finish date.

  30. ER Diagram of Staff and Branch Entities and their Attributes

  31. Entity Type • Strong Entity Type • Entity type that is not existence-dependent on some other entity type. • Weak Entity Type • Entity type that is existence-dependent on some other entity type. • E.G.) Employee’s dependents

  32. Strong Entity Type called Client and Weak Entity Type called Preference

  33. Relationship called Advertises with Attributes

More Related