er model - united states naval academy€¦ · er model entities, attributes, identifiers has-a...

Post on 13-Jun-2020

1 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

1

1

IT420: Database Management and Organization

ER Model: part 2 13 January 2006

Adina Crăiniceanuwww.cs.usna.edu/~adina

2

ER Model

Entities, attributes, identifiersHAS-A Relationships

Degree: binary, ternaryMaximum cardinalityMinimum cardinality

Weak entities ID-dependent entities; identifying relationships

IS-A RelationshipsInclusive, Exclusive

3

Goals of This Lecture

Create ER model from user requirements

2

4

ERwin Symbol Summary

5

ERwin Symbol Summary (Continued)

6

Forms, Reports and ER Model

User input: FormsReportsDiscussions

DB modeler: Entity-Relationship modelSame entities, relationships under the surface

3

7

1:1 Strong Entity Relationships

8

1:1 Strong Entity Relationships

9

1:N Strong Entity Relationships

4

10

1:N Strong Entity Relationships

11

N:M Strong Entity Relationships

12

N:M Strong Entity Relationships

5

13

N:M Strong Entity Relationships

14

The Association Pattern

Price column

15

Association Class

6

16

Entity vs. Attribute

17

Multi-valued Attribute Entity

18

Recursive Relationships

Recursive relationship: an entity has a relationship to itself

7

19

1:N Recursive Relationship

20

1:1 Recursive Relationship

21

N:M Recursive Relationship

8

22

Class Exercise

Draw ER diagram for a database used to manage IT420 class (at least 3 entities)

Specify entities, attributes, identifiersSpecify relationshipsSpecify cardinalities for relationships

23

Highline University

The Highline University [HU] database will track such entities as:

CollegesDepartmentsFacultyStudents

We have gathered a set of HU reports that will be the source documents for a data model

24

The College Report

9

25

Data Model from the College Report

26

The Department Report

27

The DEPARTMENT / PROFESSOR Relatioship:Alternate Model 1: Using a 1:N Relationship

10

28

The DEPARTMENT / PROFESSOR Relatioship:Alternate Model 1: Using a 1:N Relationship

29

The DEPARTMENT / PROFESSOR Relatioship:Alternate Model 2: Using an N:M Relationship

30

The DEPARTMENT / PROFESSOR Relatioship:Alternate Model 3: Using an Association Pattern

11

31

The DEPARTMENT / PROFESSOR Relatioship:Alternate Model 4: Using a Association Patternand a 1:N Relationship

Chaired By /Chairs

32

The Department Major Report

33

Data Model with STUDENT Entity

Chaired By /Chairs

12

34

The Student Acceptance Letter

35

Data Model with Advises Relationship

Chaired By /Chairs

36

Final Data Model

Chaired By /Chairs

13

37

ER Modeling: Case StudyDrugwarehouse.com has offered you a free life-time supply of prescription drugs (no questions asked) if you design its database schema. Given the rising cost of health care, you agree. Here is the information that you gathered:Patients are identified by their SSN, and we also store their names and ageDoctors are identified by their SSN, and we also store their names and specialtyEach patient has one primary care physicianEach doctor has at least one patientDoctors prescribe drugs for patients

top related