Chapter 7: Relational Database Design
Database System Concepts, 7th Edition
Silberschatz, Korth and Sudarshan
Chapter 6: Database Design Using the E-R Model
------------------------------------------------------------
Outline
- Overview of the Design Process
- The Entity-Relationship Model
- Complex Attributes
- Mapping Cardinalities
- Primary Key
- Removing Redundant Attributes in Entity Sets
- Reducing ER Diagrams to Relational Schemas
- Extended E-R Features
- Entity-Relationship Design Issues
- Alternative Notations for Modeling Data
- Other Aspects of Database Design
------------------------------------------------------------
Design Phases
Initial Phase:
Characterize fully the data needs of the prospective database users.
Second Phase:
- Choose a data model
- Apply concepts of the chosen data model
- Translate requirements into a conceptual schema
- Describe the kinds of operations (transactions) performed on the data
Final Phase:
Logical Design:
- Decide on database schema
- Find a good collection of relation schemas
- Decide what attributes to record
- Decide how attributes are distributed among schemas
Physical Design:
- Decide on physical layout of the database
------------------------------------------------------------
Entity-Relationship Model
Entity:
A distinguishable object in the enterprise described by attributes.
Relationship:
An association among several entities.
Primary Key:
A set of attributes that uniquely identifies each entity in an entity set.
------------------------------------------------------------
Types of Attributes
- Simple and Composite
- Single-valued and Multivalued
- Derived attributes
- Domain (set of permitted values)
------------------------------------------------------------
Mapping Cardinalities
- One-to-One
- One-to-Many
- Many-to-One
- Many-to-Many
Participation Constraints:
- Total Participation
- Partial Participation
------------------------------------------------------------
Weak Entity Sets
- Existence dependent on a strong entity
- Identified using identifying entity + discriminator
- Represented with double rectangle in ER diagram
------------------------------------------------------------
Reduction to Relation Schemas
- Each entity set → relation schema
- Each relationship set → relation schema
- Composite attributes are flattened
- Multivalued attributes represented separately
Example:
student(ID, name, tot_cred)
advisor(s_id, i_id)
------------------------------------------------------------
Extended E-R Features
- Specialization (Top-down)
- Generalization (Bottom-up)
- Completeness Constraints
- Aggregation
------------------------------------------------------------
Design Issues
- Entity vs Attribute
- Entity vs Relationship
- Binary vs Non-binary Relationships
- Strong vs Weak Entity Sets
------------------------------------------------------------
Alternative Notations
- Chen Notation
- Crow’s Foot Notation
- UML Class Diagrams
------------------------------------------------------------
Other Aspects of Database Design
- Functional Requirements
- Data Flow
- Workflow
- Schema Evolution
End of Chapter 6