170 likes | 256 Views
Learn about ERD methodology, modeling concepts, attributes, relationships, cardinality, and exercises to master data modeling concepts.
E N D
Database Analysis and Data Modeling Well done, is better than well said. ~ Benjamin Franklin ~
SDLC / DBDLC IPlanning IIAnalysis IIIDesign IVImplementation VMaintenance &Support Resources Data Analysis and Conceptual Modeling LogicalModel Conceptual Model PhysicalModel Internal / ExternalModel Time Where are we?
Chen –vs- Crow’s Foot Models Figure 3.6
Attribute Examples Vehicle Unique Identifier (PK Candidate) VIN [U]Make [R] Model ManufYearAge [D]EngineDetail [C]Color [M] Required Derived Attribute (Calc from ManufYear) Composite Attribute(HP, NumCyls, CC) Multi-valued Attribute(White with Blue Trim)
Example: Cardinality • 1-1 • 1-M • M-N Read in bothdirections!A resident possesses a DL or they don’t. A drivers license is possessed by one and only one Resident. A Resident registers zero or more Vehicles, a Vehicle is owned by one and only one resident. A Driver is Licensed to drive one or more vehicles, A vehicle is licensed to be driven by one or more drivers.
Example: Relationship Strength • Identifying Relationship • Existence-Dependent • Composite Identifier (PK) • BBPlayer is weak entity “Player must be on a team” • Non-Identifying Relationship • Existence-Independent • BBPLayer is not weak “Player need not be on a team” Any relationship can be made Strong/WeakHow and Why Depend on the Requirements!
Weak Entity • Existence-dependent on another entity • A Strong Relationship produces a weak entity • Has primary key that is partially or totally derived from parent entity Beveled Corners Figure 3.19
Example: Composite Entity Attributes Employee may or may not participate How do we represent the position the employeeholds on the project committee? Employee may or may not participate
Example: Relationship Degree Unary Binary Ternary FilmEvent is actually anassociative (weak) entitybecause it cannot existwithout the other three.
Recursive Relationships • The relationship exists between occurrences of same entity set (unary relationships)
Employee Empno Lname Fname DOB Address Hourly Salaried Rate AnnualPay StockOptns Entity Sub-Type / Super-Type • Two Distinctions: • d = disjoint • o=overlap • Helps Depict “Is a” “part of” relationships. d
3x5 Approach to ERD • Write Entity on 3x5 card • Write Attributes on back • Helps with entity placement issues in your diagram (esp. large ones)
ERD Design Methodology • Identify Entities • Identify Attributes for each Entity • For each Attribute identify the Attribute Type[C],[M],[D],[R],[U] • Identify Relationships / Bus. Rules • Establish Cardinality 1-1,1-M,M-M • Establish Participation for each end 0/1 • Work Out Relationships • Sub-Type/Super-Type (is-a/has-a) • Establish Weak Entities in 1-M • Resolve M-M’s with Data (Assoc. / Comp. Entities)
Exercises • Can you draw this diagram? • Can you establish these requirements and then draw the diagram?
Entity-Relationship Modeling Questions?