100 likes | 182 Views
The Entity-Relationship Model. Chapter 2. Database Design Basics: Six Steps in Design. Data Requirements Analysis: a) what must be stored, b) how will it be used, and c) what actions occur most often. Conceptual Database Design: Use ERD(s) to group data into entities and relationships.
E N D
The Entity-Relationship Model Chapter 2
Database Design Basics: Six Steps in Design • Data Requirements Analysis: a) what must be stored, b) how will it be used, and c) what actions occur most often. • Conceptual Database Design: Use ERD(s) to group data into entities and relationships. • Logical Database Design: Convert ERD(s) to conceptual schemas. • Schema Refinement: Eliminate redundancy and refine tables for performance. • Physical Database Design: Decide how to store and index the data. • Application and Security Design: Put the DB in the application’s context.
Employees ssn ER Model Basics Attribute (descriptive attribute), entities (relationships) possess these. Entity. A group of these is an entity set. Relationship ( if “ISA”). A group would be a relationship set. ISA Works_In
ER Model Basics (Example) name office phone ssn class name declares Major Students How do we choose a key? Candidate keys and primary keys
ER Model Basics (Example) name office phone ssn class name declares Major Students Two types of constraints to consider: key constraints and participation constratints. Key constraints can be one-to-many or many-to-many Participation constraints can be total or partial
ER Model Basics (Example) name office phone ssn class name declares Major Students Total participation (all) Key constraint (only one) Total participation and key constraint (all and only one)
ER Model: Other Concepts:Weak Entity Sets name did ssn rank name sponsors dependent member The link is “bolded” to show total participation. It must also have an arrowhead to show a key constraint. These symbols must be “bolded” to denote the weak entity set
ER Model: Other Concepts:ISA Relationships name id gender Two constraints of concern with ISA relationships: employee * Overlap (no by default) isa * Covering (no by default) faculty staff student salary contract wage date ins date wage
ER Model: Other Concepts:Aggregation addr order phone name name hires agent customer Could also use a ternary relationship Prod # price name quantity buys product