extending er diagrams 4 4 l.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Extending ER Diagrams (4.4) PowerPoint Presentation
Download Presentation
Extending ER Diagrams (4.4)

Loading in 2 Seconds...

play fullscreen
1 / 12

Extending ER Diagrams (4.4) - PowerPoint PPT Presentation


  • 967 Views
  • Uploaded on

Extending ER Diagrams (4.4) CPSC 356 Database Ellen Walker Hiram College (Includes figures from Database Systems: An Application-Oriented Approach 2ed , by Kifer, Bernstein & Lewis, © Addison Wesley 2005) Basic ER Diagram Cannot Capture Specialization/ Generalization Examples

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Extending ER Diagrams (4.4)' - adamdaniel


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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
extending er diagrams 4 4

Extending ER Diagrams (4.4)

CPSC 356 Database

Ellen Walker

Hiram College

(Includes figures from Database Systems: An Application-Oriented Approach 2ed, by Kifer, Bernstein & Lewis, © Addison Wesley 2005)

basic er diagram cannot capture specialization generalization
Basic ER Diagram Cannot Capture Specialization/ Generalization
  • Examples
    • Doctors and Nurses are Medical Staff
    • Staff includes Medical staff, Secretarial staff, Housekeeping staff, etc.
  • Relationships might include Doctors, Medical Staff, and/or Staff
  • ER diagram cannot represent the fact that Staff > Medical staff > doctors
  • EER diagram can!
entity type hierarchies
Entity Type Hierarchies
  • An entity type E1 is a subtype of the entity type E2 when
    • Every entity instance of E1 is also an instance of E2
    • Every attribute in E2 is also in E1
  • The opposite of a subtype is a supertype
  • Subtypes are related to supertypes through the IS-A relationship
subtype supertype example

IS-A

IS-A

Subtype / Supertype Example
  • Doctor is a subtype of medical-staff
  • Staff is a supertype of medical-staff

Staff

  • Attributes
    • Staff - name, addr, salary
    • Med-staff - pager #
    • Doctor - license #

Medical-Staff

Admin-Staff

Doctor

Nurse

attribute inheritance
Attribute Inheritance
  • Each entity type inherits all attributes of its supertype(s)
    • Staff has name, address, salary
    • Medical staff has {n,a,s} + beeper-number
    • Doctor has {n, a, s, b#} + license #
  • In EER diagram, inherited attributes only appear once (in the highest supertype)
generalizing type hierarchies
Generalizing Type Hierarchies
  • Multiple supertypes for the same subtype
    • A student-employee is both a student and an employee
  • Overlapping subtypes
    • Subclasses of person are student and employee
    • There is at least one individual who is both a student and an employee
  • Non-overlapping subtypes are called “disjoint”
extended er eer diagram
Extended ER (EER) Diagram
  • IS-A relationships
  • Notation for disjoint (vs. overlapping) subtypes
  • Notation for “covering”
    • Can someone be staff without being Medical or administrative?
additional semantic relationships
Additional Semantic Relationships
  • Aggregation and Composition
    • Collecting together related entities that represent ‘parts’ of a ‘whole’
    • Aggregation (non-exclusive subpart): parts can change parents
    • Composition (exclusive subpart): single parent, very strong association - parts make no sense without parent
    • Examples:
      • Branch (whole) has Staff (part) Aggregation
      • Newspaper (whole) contains Story (part) Composition
  • EER representation is diamond with arrow from “part”
exclusive subpart weak entity
Exclusive Subpart = Weak Entity
  • A Weak Entity depends on some related entity for its existence. It has no candidate keys without including the primary key of the entity it depends on.
  • Example
    • Employee ( empNo, fname, lname salary,…) HAS Dependent (fname)
    • Dependent is not represented without employee
    • Parent’s record used to distinguish (e.g.) Jennifers