1 / 14

Database Systems {week 05}

Rensselaer Polytechnic Institute CSCI-4380 – Database Systems David Goldschmidt, Ph.D. Database Systems {week 05}. E/R models (review). Modeling a database begins by identifying the information to be stored Need to also define how information elements are related to one another

dugan
Download Presentation

Database Systems {week 05}

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. Rensselaer Polytechnic Institute CSCI-4380 – Database Systems David Goldschmidt, Ph.D. Database Systems{week 05}

  2. E/R models (review) • Modeling a database begins by identifying the information to be stored • Need to also define how information elements are related to one another • Further, define constraintson the information,including defining keys,referential integrity, etc.

  3. E/R modeling goals • Fundamental goals of E/R modeling: • Capture and document all requirementsand business rules as clearly and exactlyas possible • Satisfy all requirements of the given problem • Produce E/R diagrams that are easily translatable into relational models/implementations

  4. Degree constraints • Each course has many enrolled students • Each student enrolls in many classes,but the maximum for each student is 6 <= 6 Students enroll-in Courses

  5. Referential integrity • In a referential-integrity constraint, an entity in one set is required to have an entity in another set to which it is related • Each department has exactly onechair • Each faculty member can be chair ofat most one department “exactly one” “at most one” Faculty chair-of Departments C

  6. Subclasses People • Much like OOP, we candefine subclasses in anE/R diagram • We identify parent/childentity sets via the is-arelationship • The Students andFaculty relations inherit all attributes of People • This includes the key(s) of People is-a Students Faculty

  7. Specialization via subclasses generalization Students is-a Undergrads Graduates specialization Is this a good design?

  8. Weak entity sets keyB keyA • A weak entity set is one in which itskey is not guaranteed to be unique • The weak entity set is always linked toone or more (strong) entity sets Weak Entity Set Strong Entity Set support C

  9. Weak entity sets keyB keyA • Weak entities are determined by one or more supporting entities • The key of the supporting entities are appended to the key of the weak entity • keyA is not unique, but the combined keyA-keyB should be unique Strong Entity Set Weak Entity Set support C

  10. Weak entity sets – example #1 empid name • Dependent names are not guaranteed unique • Names of dependents of a given employee are guaranteed to be unique • Each dependent depends on exactly one employee (required) Employees Dependents depend C

  11. Weak entity sets – example #2 deptid name • Course names are not guaranteed to be unique • Names of courses within a given departmentare guaranteed to be unique • Each course is offered in exactly onedepartment (required) Departments Courses offered C

  12. Weak entity sets – example #3 Students C Advisors advises has serves-as Majors C Faculty C

  13. Exercises (reminder!) • Go back to the relations we’veworked with in class and createE/R diagrams for each • e.g. MusicGroup, Company • Also create a detailed E/R diagram for the celebrities relations (and relationships!) • see next slide....

  14. Exercises (reminder!)

More Related