0% found this document useful (0 votes)
69 views25 pages

Data Modeling (DM) Using Entity-Relationship Model: Text Book Sections: All

database course

Uploaded by

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

Data Modeling (DM) Using Entity-Relationship Model: Text Book Sections: All

database course

Uploaded by

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

Data Modeling (DM) Using Entity-

Relationship Model

Chapter 3

Text book Sections: All

1
Outline …

 Using High-Level Conceptual Data Models for Database Design

 A Sample Database Application

 Entity Types, Entity Sets, Attributes, and Keys

 Relationship Types, Relationship Sets, Roles, and Structural Constraints

 Weak Entity Types

 Refining the ER Design for the COMPANY Database

 ER Diagrams, Naming Conventions, and Design Issues

 Relationship Types of Degree Higher than Two

2
Using High-Level Conceptual DMs for DB Design

 Requirements collection and analysis

 Conceptual DB design

 Logical DB design

 Physical DB design

 Implementation

3
DM Using the Entity-Relationship (ER) Model

 Entity-Relationship (ER) model: Popular high-level conceptual data model

 ER diagrams: Diagrammatic notation associated with the ER model

 Unified Modeling Language (UML)

4
Example: Requirements of a COMPANY

 The company wants a record of each employee’s name, id, age, ….


 An employee can have many dependents
 An employee can work in many projects
 Each project has a name, a unique number, a location ….
 An employee belongs to one department
 A project belongs to one department
 A department has a unique number, a manager, and many locations
 ….
 ….
 ...

November 12, 2022 ICS324 5


6
ER Model

 ER model describes data as:


 Entities
 Relationships
 Attributes

7
Entities and Attributes …

 Entity
 Thing in real world with independent existence
 Attributes
 Particular properties that describe entity
 Types of attributes:
 Composite versus simple (atomic) attributes
 Single-valued versus multivalued attributes
 Stored versus derived attributes
 Key attributes

8
… Entities and Attributes

9
Entity Types, Entity Sets, Keys, and Value Sets …

 Entity type: Collection (or set) of entities that have the same attributes

10
… Entity Types, Entity Sets, Keys, and Value Sets …

 Key or uniqueness constraint


 Attributes whose values are distinct for each individual entity in entity set
 Key attribute: Uniqueness property must hold for every entity set of the
entity type

 Value sets (or domain of values)


 Specifies set of values that may be assigned to that attribute for each
individual entity

11
Initial Conceptual Design of the COMPANY DB

12
Relationship Types, Relationship Sets, Roles, and
Structural Constraints

 Relationship type R among n entity types E1, E2, ..., En


 Defines a set of associations among entities from these entity types

 Relationship instances ri
 Each ri associates n individual entities (e1, e2, ..., en)
 Each entity ej in ri is a member of entity set Ej

 Degree of a relationship type


 Number of participating entity types
 Binary, ternary

13
Turnery Relationship

14
Role Names and Recursive Relationships

 Role names: signifies role that a participating entity plays in each relationship
instance

 Recursive relationships
 Same entity type participates more than once in a relationship type in
different roles
 Must specify role name

15
Recursive Relationship

16
Constraints on Binary Relationship Types

 Cardinality ratio for a binary relationship


 Specifies maximum number of relationship instances that entity can
participate in

 Participation constraint
 Specifies whether existence of entity depends on its being related to another
entity
 Types: total and partial

17
Attributes of Relationship Types

 Attributes of 1:1 or 1:N relationship types can be migrated to one entity type

 For a 1:N relationship type


 Relationship attribute can be migrated only to entity type on N-side of
relationship

 For M:N relationship types


 Some attributes may be determined by combination of participating entities
 Must be specified as relationship attributes

18
Weak Entity Types

 Do not have key attributes of their own. They are Identified by being related to
specific entities from another entity type

 Identifying relationship: Relates a weak entity type to its owner

 Always has a total participation constraint

19
ER Diagrams, Naming Conventions, and Design Issues

20
Alternative Notations for ER Diagrams

 Specify structural constraints on relationships

 Replaces cardinality ratio (1:1, 1:N, M:N) and single/double line notation for
participation constraints

 Associate a pair of integer numbers (min, max) with each participation of an


entity type E in a relationship type R, where 0 ≤ min ≤ max and max ≥ 1

21
22
Reading List

 http://www.databaseanswers.org/data_models/

23
24
Disclaimer

 The lecture slides contain original work of Elmasri & Navathe. The slides are
intended for the sole purpose of instruction of Database Systems course at
KFUPM. All copyrighted materials belong to their original owner(s).

25

You might also like