Presentation is loading. Please wait.

Presentation is loading. Please wait.

Rensselaer Polytechnic Institute CSCI-4380 – Database Systems David Goldschmidt, Ph.D.

Similar presentations


Presentation on theme: "Rensselaer Polytechnic Institute CSCI-4380 – Database Systems David Goldschmidt, Ph.D."— Presentation transcript:

1 Rensselaer Polytechnic Institute CSCI-4380 – Database Systems David Goldschmidt, Ph.D.

2  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 constraints on the information, including defining keys, referential integrity, etc.

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

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

5  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 one chair  Each faculty member can be chair of at most one department Faculty Departments chair-of C “exactly one”“at most one”

6  Much like OOP, we can define subclasses in an E/R diagram  We identify parent/child entity sets via the is-a relationship  The Students and Faculty relations inherit all attributes of People ▪ This includes the key(s) of People Students Faculty People is-a

7 Undergrads Graduates Students is-a specialization generalization Is this a good design?

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

9  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 support keyB keyA Weak Entity Set C

10  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 depend empid name Dependents C

11  Course names are not guaranteed to be unique  Names of courses within a given department are guaranteed to be unique  Each course is offered in exactly one department (required) Departments offered deptid name Courses C

12 Advisors Students advises C Majors has C Faculty serves-as C

13  Go back to the relations we’ve worked with in class and create E/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


Download ppt "Rensselaer Polytechnic Institute CSCI-4380 – Database Systems David Goldschmidt, Ph.D."

Similar presentations


Ads by Google