Stephen C. Hayne Data Modeling zMethod yidentify/describe data entities zNotation yway to illustrate...
-
Upload
destiny-warren -
Category
Documents
-
view
212 -
download
0
Transcript of Stephen C. Hayne Data Modeling zMethod yidentify/describe data entities zNotation yway to illustrate...
![Page 1: Stephen C. Hayne Data Modeling zMethod yidentify/describe data entities zNotation yway to illustrate findings zApproaches yNormalization yEntity Relationship.](https://reader035.fdocuments.us/reader035/viewer/2022070305/5513e2515503466f748b5503/html5/thumbnails/1.jpg)
Stephen C. Hayne
Data Modeling
Method identify/describe data entities
Notation way to illustrate findings
Approaches Normalization Entity Relationship
![Page 2: Stephen C. Hayne Data Modeling zMethod yidentify/describe data entities zNotation yway to illustrate findings zApproaches yNormalization yEntity Relationship.](https://reader035.fdocuments.us/reader035/viewer/2022070305/5513e2515503466f748b5503/html5/thumbnails/2.jpg)
Entity Relationship Model
Strong and weak entity typesAttributesBinary relationshipsDesign problemsRecursion and generalization
![Page 3: Stephen C. Hayne Data Modeling zMethod yidentify/describe data entities zNotation yway to illustrate findings zApproaches yNormalization yEntity Relationship.](https://reader035.fdocuments.us/reader035/viewer/2022070305/5513e2515503466f748b5503/html5/thumbnails/3.jpg)
Stephen C. Hayne
Basic concepts
Entity identifiable object or concept
Attribute property of an entity or relationship
Relationship an association among entities
Identifier one or more attributes identifying an
instance of an entity
![Page 4: Stephen C. Hayne Data Modeling zMethod yidentify/describe data entities zNotation yway to illustrate findings zApproaches yNormalization yEntity Relationship.](https://reader035.fdocuments.us/reader035/viewer/2022070305/5513e2515503466f748b5503/html5/thumbnails/4.jpg)
Stephen C. Hayne
Entity (or entity class) vs. entity instance
![Page 5: Stephen C. Hayne Data Modeling zMethod yidentify/describe data entities zNotation yway to illustrate findings zApproaches yNormalization yEntity Relationship.](https://reader035.fdocuments.us/reader035/viewer/2022070305/5513e2515503466f748b5503/html5/thumbnails/5.jpg)
Stephen C. Hayne
Entity types
Strong existence does not depend on the existence
of another entity
Weak existence is dependent on the existence of
another entity business rules vs. logical dependence ID-dependence (physical dependence)
![Page 6: Stephen C. Hayne Data Modeling zMethod yidentify/describe data entities zNotation yway to illustrate findings zApproaches yNormalization yEntity Relationship.](https://reader035.fdocuments.us/reader035/viewer/2022070305/5513e2515503466f748b5503/html5/thumbnails/6.jpg)
Stephen C. Hayne
Entity-Relationship Model
Relationship
Identifying Relationship
Entity
Weak Entity
![Page 7: Stephen C. Hayne Data Modeling zMethod yidentify/describe data entities zNotation yway to illustrate findings zApproaches yNormalization yEntity Relationship.](https://reader035.fdocuments.us/reader035/viewer/2022070305/5513e2515503466f748b5503/html5/thumbnails/7.jpg)
Stephen C. Hayne
Entity examples
Staff
Branch
Nextof Kin
Room
Which are strong, weak, ID-dependent entities?
![Page 8: Stephen C. Hayne Data Modeling zMethod yidentify/describe data entities zNotation yway to illustrate findings zApproaches yNormalization yEntity Relationship.](https://reader035.fdocuments.us/reader035/viewer/2022070305/5513e2515503466f748b5503/html5/thumbnails/8.jpg)
Stephen C. Hayne
Attributes or properties
DORMITORY
Location
DormName
Number of Rooms
DORMITORYDormNameLocationNumber of Rooms
![Page 9: Stephen C. Hayne Data Modeling zMethod yidentify/describe data entities zNotation yway to illustrate findings zApproaches yNormalization yEntity Relationship.](https://reader035.fdocuments.us/reader035/viewer/2022070305/5513e2515503466f748b5503/html5/thumbnails/9.jpg)
Stephen C. Hayne
Identifiers
Non-unique LastName
Unique (key) SSN
Composite {AreaCode, LocalNumber} (is this unique?)
![Page 10: Stephen C. Hayne Data Modeling zMethod yidentify/describe data entities zNotation yway to illustrate findings zApproaches yNormalization yEntity Relationship.](https://reader035.fdocuments.us/reader035/viewer/2022070305/5513e2515503466f748b5503/html5/thumbnails/10.jpg)
Stephen C. Hayne
Binary relationships: HAS-A
IsAssigned
Occupies
BelongsTo
![Page 11: Stephen C. Hayne Data Modeling zMethod yidentify/describe data entities zNotation yway to illustrate findings zApproaches yNormalization yEntity Relationship.](https://reader035.fdocuments.us/reader035/viewer/2022070305/5513e2515503466f748b5503/html5/thumbnails/11.jpg)
Stephen C. Hayne
Binary Relationship
Student Class0:N 0:35IsEnrolledIn
PartialParticipation
![Page 12: Stephen C. Hayne Data Modeling zMethod yidentify/describe data entities zNotation yway to illustrate findings zApproaches yNormalization yEntity Relationship.](https://reader035.fdocuments.us/reader035/viewer/2022070305/5513e2515503466f748b5503/html5/thumbnails/12.jpg)
Stephen C. Hayne
Binary Relationship
Student Class1:N 1:NIsEnrolledIn
TotalParticipation
![Page 13: Stephen C. Hayne Data Modeling zMethod yidentify/describe data entities zNotation yway to illustrate findings zApproaches yNormalization yEntity Relationship.](https://reader035.fdocuments.us/reader035/viewer/2022070305/5513e2515503466f748b5503/html5/thumbnails/13.jpg)
Stephen C. Hayne
Ternary relationships
Can often (always) split one relationship of degree 3 into two (three) relationships of degree 2; are these independent?...
![Page 14: Stephen C. Hayne Data Modeling zMethod yidentify/describe data entities zNotation yway to illustrate findings zApproaches yNormalization yEntity Relationship.](https://reader035.fdocuments.us/reader035/viewer/2022070305/5513e2515503466f748b5503/html5/thumbnails/14.jpg)
Stephen C. Hayne
More on relationships
Relationship classes vs. instancesRelationships can have attributes
(equivalent to degree=3)Crow’s feet representation of cardinality
Rent
![Page 15: Stephen C. Hayne Data Modeling zMethod yidentify/describe data entities zNotation yway to illustrate findings zApproaches yNormalization yEntity Relationship.](https://reader035.fdocuments.us/reader035/viewer/2022070305/5513e2515503466f748b5503/html5/thumbnails/15.jpg)
Stephen C. Hayne
Cardinality
Number of elements allowed on each side of a relationship (participants)
Maximum Cardinality Maximum number of entities that can be involved
in relationship: typically 1 or many
Minimum Cardinality Minimum number of entities that MUST be involved
in relationship : typically 0 or 1 Also called participation constraints: total or partial
![Page 16: Stephen C. Hayne Data Modeling zMethod yidentify/describe data entities zNotation yway to illustrate findings zApproaches yNormalization yEntity Relationship.](https://reader035.fdocuments.us/reader035/viewer/2022070305/5513e2515503466f748b5503/html5/thumbnails/16.jpg)
Stephen C. Hayne
Cardinality constraints
PROPERTYOWNER 1:N
Owns
AUTOEMPLOYEE 1:1
Assigned
CLUBSTUDENT N:M
Joins
![Page 17: Stephen C. Hayne Data Modeling zMethod yidentify/describe data entities zNotation yway to illustrate findings zApproaches yNormalization yEntity Relationship.](https://reader035.fdocuments.us/reader035/viewer/2022070305/5513e2515503466f748b5503/html5/thumbnails/17.jpg)
Stephen C. Hayne
Fan trapsMultiple 1:N relationships from the same entity
where a relationship between child entities is required
Solve it!
![Page 18: Stephen C. Hayne Data Modeling zMethod yidentify/describe data entities zNotation yway to illustrate findings zApproaches yNormalization yEntity Relationship.](https://reader035.fdocuments.us/reader035/viewer/2022070305/5513e2515503466f748b5503/html5/thumbnails/18.jpg)
Stephen C. Hayne
Fan traps
Solution
![Page 19: Stephen C. Hayne Data Modeling zMethod yidentify/describe data entities zNotation yway to illustrate findings zApproaches yNormalization yEntity Relationship.](https://reader035.fdocuments.us/reader035/viewer/2022070305/5513e2515503466f748b5503/html5/thumbnails/19.jpg)
Stephen C. Hayne
Chasm traps
Missing a required pathway between entitiesSingle line: partial participationSolve it!
![Page 20: Stephen C. Hayne Data Modeling zMethod yidentify/describe data entities zNotation yway to illustrate findings zApproaches yNormalization yEntity Relationship.](https://reader035.fdocuments.us/reader035/viewer/2022070305/5513e2515503466f748b5503/html5/thumbnails/20.jpg)
Stephen C. Hayne
Chasm traps
Solution
![Page 21: Stephen C. Hayne Data Modeling zMethod yidentify/describe data entities zNotation yway to illustrate findings zApproaches yNormalization yEntity Relationship.](https://reader035.fdocuments.us/reader035/viewer/2022070305/5513e2515503466f748b5503/html5/thumbnails/21.jpg)
Stephen C. Hayne
Recursive relationships
Participants are instances of same class
![Page 22: Stephen C. Hayne Data Modeling zMethod yidentify/describe data entities zNotation yway to illustrate findings zApproaches yNormalization yEntity Relationship.](https://reader035.fdocuments.us/reader035/viewer/2022070305/5513e2515503466f748b5503/html5/thumbnails/22.jpg)
Stephen C. Hayne
Recursive Relationship
VolunteerSupervisor
Supervisee
Supervises
Role Name
0:N
1:1
![Page 23: Stephen C. Hayne Data Modeling zMethod yidentify/describe data entities zNotation yway to illustrate findings zApproaches yNormalization yEntity Relationship.](https://reader035.fdocuments.us/reader035/viewer/2022070305/5513e2515503466f748b5503/html5/thumbnails/23.jpg)
Stephen C. Hayne
Weak relationship
Relationships involving weak entities Logical dependency
ID-dependency
![Page 24: Stephen C. Hayne Data Modeling zMethod yidentify/describe data entities zNotation yway to illustrate findings zApproaches yNormalization yEntity Relationship.](https://reader035.fdocuments.us/reader035/viewer/2022070305/5513e2515503466f748b5503/html5/thumbnails/24.jpg)
Stephen C. Hayne
A full E-R diagram example
Properties can be shown in the diagram or listed separately
![Page 25: Stephen C. Hayne Data Modeling zMethod yidentify/describe data entities zNotation yway to illustrate findings zApproaches yNormalization yEntity Relationship.](https://reader035.fdocuments.us/reader035/viewer/2022070305/5513e2515503466f748b5503/html5/thumbnails/25.jpg)
Stephen C. Hayne
Supertype & subtype entities
Exclusive vs. non-exclusive subtypesRequired vs. optional subtypes
![Page 26: Stephen C. Hayne Data Modeling zMethod yidentify/describe data entities zNotation yway to illustrate findings zApproaches yNormalization yEntity Relationship.](https://reader035.fdocuments.us/reader035/viewer/2022070305/5513e2515503466f748b5503/html5/thumbnails/26.jpg)
Stephen C. Hayne
Generalization hierarchy
Represented by supertypes & subtypes
Also called: type hierarchy IS-A relationships
Inheritance subtype entities inherit
attributes of supertype entity
![Page 27: Stephen C. Hayne Data Modeling zMethod yidentify/describe data entities zNotation yway to illustrate findings zApproaches yNormalization yEntity Relationship.](https://reader035.fdocuments.us/reader035/viewer/2022070305/5513e2515503466f748b5503/html5/thumbnails/27.jpg)
Stephen C. Hayne
Putting it together
Add business rules Constraints, restrictions, protocols Document the rules
Evaluate your data model! What queries can you pose? Are there any connection traps? Does it model the users’ model of the business
world?
![Page 28: Stephen C. Hayne Data Modeling zMethod yidentify/describe data entities zNotation yway to illustrate findings zApproaches yNormalization yEntity Relationship.](https://reader035.fdocuments.us/reader035/viewer/2022070305/5513e2515503466f748b5503/html5/thumbnails/28.jpg)
Stephen C. Hayne
•Form pairs•Find:
•1 business rule•1 query
•Share