Presentation is loading. Please wait.

Presentation is loading. Please wait.

Stephen C. Hayne Data Modeling zMethod yidentify/describe data entities zNotation yway to illustrate findings zApproaches yNormalization yEntity Relationship.

Similar presentations


Presentation on theme: "Stephen C. Hayne Data Modeling zMethod yidentify/describe data entities zNotation yway to illustrate findings zApproaches yNormalization yEntity Relationship."— Presentation transcript:

1 Stephen C. Hayne Data Modeling zMethod yidentify/describe data entities zNotation yway to illustrate findings zApproaches yNormalization yEntity Relationship

2 Entity Relationship Model zStrong and weak entity types zAttributes zBinary relationships zDesign problems zRecursion and generalization

3 Stephen C. Hayne Basic concepts zEntity yidentifiable object or concept zAttribute yproperty of an entity or relationship zRelationship yan association among entities zIdentifier yone or more attributes identifying an instance of an entity

4 Stephen C. Hayne Entity (or entity class) vs. entity instance

5 Stephen C. Hayne Entity types zStrong yexistence does not depend on the existence of another entity zWeak yexistence is dependent on the existence of another entity ybusiness rules vs. logical dependence yID-dependence (physical dependence)

6 Stephen C. Hayne Entity-Relationship Model Relationship Identifying Relationship Entity Weak Entity

7 Stephen C. Hayne Entity examples Staff Branch Next of Kin Room zWhich are strong, weak, ID-dependent entities?

8 Stephen C. Hayne Attributes or properties DORMITORY Location DormName Number of Rooms DORMITORY DormName Location Number of Rooms

9 Stephen C. Hayne Identifiers zNon-unique yLastName zUnique (key) ySSN zComposite y{AreaCode, LocalNumber} y(is this unique?)

10 Stephen C. Hayne Binary relationships: HAS-A IsAssignedOccupies BelongsTo

11 Stephen C. Hayne Binary Relationship StudentClass 0:N0:35 IsEnrolledIn Partial Participation

12 Stephen C. Hayne Binary Relationship StudentClass 1:N IsEnrolledIn Total Participation

13 Stephen C. Hayne Ternary relationships zCan often (always) split one relationship of degree 3 into two (three) relationships of degree 2; are these independent?...

14 Stephen C. Hayne More on relationships zRelationship classes vs. instances zRelationships can have attributes (equivalent to degree=3) zCrows feet representation of cardinality Rent

15 Stephen C. Hayne Cardinality zNumber of elements allowed on each side of a relationship (participants) zMaximum Cardinality yMaximum number of entities that can be involved in relationship: typically 1 or many zMinimum Cardinality yMinimum number of entities that MUST be involved in relationship : typically 0 or 1 yAlso called participation constraints: total or partial

16 Stephen C. Hayne Cardinality constraints PROPERTYOWNER 1:N Owns AUTOEMPLOYEE 1:1 Assigned CLUBSTUDENT N:M Joins

17 Stephen C. Hayne Fan traps zMultiple 1:N relationships from the same entity where a relationship between child entities is required zSolve it!

18 Stephen C. Hayne Fan traps Solution

19 Stephen C. Hayne Chasm traps zMissing a required pathway between entities zSingle line: partial participation zSolve it!

20 Stephen C. Hayne Chasm traps Solution

21 Stephen C. Hayne Recursive relationships zParticipants are instances of same class

22 Stephen C. Hayne Recursive Relationship Volunteer Supervisor Supervisee Supervises Role Name 0:N 1:1

23 Stephen C. Hayne Weak relationship zRelationships involving weak entities yLogical dependency yID-dependency

24 Stephen C. Hayne A full E-R diagram example zProperties can be shown in the diagram or listed separately

25 Stephen C. Hayne Supertype & subtype entities zExclusive vs. non-exclusive subtypes zRequired vs. optional subtypes

26 Stephen C. Hayne Generalization hierarchy zRepresented by supertypes & subtypes zAlso called: ytype hierarchy yIS-A relationships zInheritance ysubtype entities inherit attributes of supertype entity

27 Stephen C. Hayne Putting it together zAdd business rules yConstraints, restrictions, protocols yDocument the rules zEvaluate your data model! yWhat queries can you pose? yAre there any connection traps? yDoes it model the users model of the business world?

28 Stephen C. Hayne Form pairs Find: 1 business rule 1 query Share


Download ppt "Stephen C. Hayne Data Modeling zMethod yidentify/describe data entities zNotation yway to illustrate findings zApproaches yNormalization yEntity Relationship."

Similar presentations


Ads by Google