0% found this document useful (0 votes)
2 views13 pages

Database Management System Lecture 02 Intro Into Relational Database

Chapter 6 discusses the phases of database design using the Entity-Relationship (E-R) model, including initial characterization of data needs, choosing a data model, and transitioning to implementation. It emphasizes avoiding redundancy and incompleteness in design while outlining the representation of entities and relationships through diagrams. The chapter also details how to represent entity sets and relationship sets, including their attributes and primary keys.

Uploaded by

ridwan.rafi01
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views13 pages

Database Management System Lecture 02 Intro Into Relational Database

Chapter 6 discusses the phases of database design using the Entity-Relationship (E-R) model, including initial characterization of data needs, choosing a data model, and transitioning to implementation. It emphasizes avoiding redundancy and incompleteness in design while outlining the representation of entities and relationships through diagrams. The chapter also details how to represent entity sets and relationship sets, including their attributes and primary keys.

Uploaded by

ridwan.rafi01
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 13

Chapter 6: Database Design Using the E-R Model

Database System Concepts, 7th Ed.


©Silberschatz, Korth and Sudarshan
See www.db-book.com for conditions on re-use
Design Phases

 Initial phase -- characterize fully the data needs of the prospective


database users.
 Second phase -- choosing a data model
• Applying the concepts of the chosen data model
• Translating these requirements into a conceptual schema of the
database.
• A fully developed conceptual schema indicates the functional
requirements of the enterprise.
 Describe the kinds of operations (or transactions) that will be
performed on the data.

Database System Concepts - 7th Edition 6.2 ©Silberschatz, Korth and Sudarshan
Design Phases (Cont.)

 Final Phase -- Moving from an abstract data model to the implementation


of the database
• Logical Design – Deciding on the database schema.
 Database design requires that we find a “good” collection of
relation schemas.
 Business decision – What attributes should we record in the
database?
 Computer Science decision – What relation schemas should we
have and how should the attributes be distributed among the
various relation schemas?
• Physical Design – Deciding on the physical layout of the database

Database System Concepts - 7th Edition 6.3 ©Silberschatz, Korth and Sudarshan
Design Alternatives

 In designing a database schema, we must ensure that we avoid two


major pitfalls:
• Redundancy: a bad design may result in repeat information.
 Redundant representation of information may lead to data
inconsistency among the various copies of information
• Incompleteness: a bad design may make certain aspects of the
enterprise difficult or impossible to model.
 Avoiding bad designs is not enough. There may be a large number of
good designs from which we must choose.

Database System Concepts - 7th Edition 6.4 ©Silberschatz, Korth and Sudarshan
Design Approaches

 Entity Relationship Model (covered in this chapter)


• Models an enterprise as a collection of entities and relationships
 Entity: a “thing” or “object” in the enterprise that is distinguishable
from other objects
• Described by a set of attributes
 Relationship: an association among several entities

• Represented diagrammatically by an entity-relationship diagram:


 Normalization Theory (Chapter 7)
• Formalize what designs are bad, and test for them

Database System Concepts - 7th Edition 6.5 ©Silberschatz, Korth and Sudarshan
Outline of the ER Model

Database System Concepts - 7th Edition 6.6 ©Silberschatz, Korth and Sudarshan
Entity Sets
 An entity is an object that exists and is distinguishable from other
objects.
• Example: specific person, company, event, plant
 An entity set is a set of entities of the same type that share the same
properties.
• Example: set of all persons, companies, trees, holidays
 An entity is represented by a set of attributes; i.e., descriptive properties
possessed by all members of an entity set.
• Example:
instructor = (ID, name, salary )
course= (course_id, title, credits)
 A subset of the attributes form a primary key of the entity set; i.e.,
uniquely identifying each member of the set.

Database System Concepts - 7th Edition 6.8 ©Silberschatz, Korth and Sudarshan
Representing Entity sets in ER Diagram

 Entity sets can be represented graphically as follows:


• Rectangles represent entity sets.
• Attributes listed inside entity rectangle
• Underline indicates primary key attributes

Database System Concepts - 7th Edition 6.10 ©Silberschatz, Korth and Sudarshan
Relationship Sets

 A relationship is an association among several entities


Example:
44553 (Peltier) advisor 22222 (Einstein)
student entity relationship set instructor entity
 A relationship set is a mathematical relation among n  2 entities, each
taken from entity sets
{(e1, e2, … en) | e1  E1, e2  E2, …, en  En}

where (e1, e2, …, en) is a relationship


• Example:
(44553,22222)  advisor

Database System Concepts - 7th Edition 6.11 ©Silberschatz, Korth and Sudarshan
Relationship Sets (Cont.)

 Example: we define the relationship set advisor to denote the


associations between students and the instructors who act as their
advisors.
 Pictorially, we draw a line between related entities.

Database System Concepts - 7th Edition 6.12 ©Silberschatz, Korth and Sudarshan
Representing Relationship Sets via ER Diagrams

 Diamonds represent relationship sets.

Database System Concepts - 7th Edition 6.13 ©Silberschatz, Korth and Sudarshan
Relationship Sets (Cont.)
 An attribute can also be associated with a relationship set.
 For instance, the advisor relationship set between entity sets instructor
and student may have the attribute date which tracks when the student
started being associated with the advisor

Database System Concepts - 7th Edition 6.14 ©Silberschatz, Korth and Sudarshan
Relationship Sets with Attributes

Database System Concepts - 7th Edition 6.15 ©Silberschatz, Korth and Sudarshan

You might also like