You are on page 1of 4

Chapter 3

Entity Relationship (ER) Modeling


2 Entity Relationship Diagram(ERD)

§ERD depicts the:


§Conceptual database as viewed by end user ( it’s a model) §Database’s main components

§Entities §Attributes §Relationships

§Entity - Refers to the entity set and not to a single entity occurrence (STUDENT(STUD_ID,
F_NAME, ADDRESS, PHONE))

3 Attributes
§Characteristics of entities
§Required attribute: Must have a value, cannot be left empty §Optional attribute: Does not
require a value, can be left empty §Domain - Set of possible values for a given attribute

E.G: GPA (0,4), COURSE(0,5)


§Identifiers: One or more attributes that uniquely identify each entity

instance (Usually refer to PK)

§§

4 Figure 4.1 - The Attributes of the Student Entity: Chen and Crow’s Foot

5 Attributes

§Composite identifier: Primary key composed of more than one attribute

§Composite attribute: Attribute that can be subdivided to yield additional attributes (e.g.,
ADRESS – street, building, P.O box etc.)

§Simple attribute: Attribute that cannot be subdivided (E.g., Gender à (M,F))

§§

6 Figure 4.3 - A Multivalued Attribute in an Entity


7 Figure 4.4 – Splitting the Multivalued Attributes into New

Attributes
8

6
7 Figure 4.4 – Splitting the Multivalued Attributes into New

Attributes

8 Attributes
§Derived attribute: Attribute whose value is calculated from other

attributes
§Derived using an algorithm §E.g AVE à (SUM/TOTAL)

9 Figure 4.6 - Depiction of a Derived Attribute 10 Relationships

§Association between entities that always operate in both directions §Connectivity: Describes
the relationship classification (1:1, 1:M,

M:N)

§Cardinality: Expresses the minimum and maximum number of entity occurrences associated
with one occurrence of related entity (Domain)

§§§

11 Figure 4.7 - Connectivity and Cardinality in an ERD

12 Relationship Strength (Only in Crow’s Notation)

13 Relationship Strength (Only in Crow’s Notation) §Weak relationship

COURSE (CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT)


CLASS (CLASS_CODE, CRS_CODE, CLASS_SEC, CLASS_TIME)

§Strong relationship
COURSE (CRS_CODE, DEPT_CODE, CRS_DESCRIPTION,

CRS_CREDIT)
CLASS (CLASS_CODE, CRS_CODE, CLASS_TIME, ROOM_NUM, PROF_ID)

14 Figure 4.8 - A Weak (Non-Identifying) Relationship between COURSE and CLASS

15 Figure 4.9 - A Strong (Identifying) Relationship between COURSE and CLASS


16 Relationship Participation 17
18

15

16 Relationship Participation

17 Table 4.3 - Crow’s Foot Symbols

18 Relationship Degree
§Indicates the number of entities or participants associated with a

relationship
§Unary relationship: Association is maintained within a single entity

§Recursive relationship: Relationship exists between occurrences of the same entity set

§Employee has to report to Head department (Employee) §Football team (players) is captained
by a captain (Player) §A course has a pre-requisite course (course)

§Binary relationship: Two entities are associated §Ternary relationship: Three entities are
associated

19 Figure 4.15 - Three Types of Relationship Degree

20 Figure 4.17 - An ER Representation of Recursive Relationships

21 Associative (Composite) Entities


§Used to represent an M:N relationship between two or more entities

§E.g.: Students can register many courses (M:N)


§May also contain additional attributes that play no role in

connective process
§In relational DB, M:N is not allowed.
§Split the M:N relationship to a 1:M relationship.

§Compose new entity that consists primary key attributes of each parent entity

22 Associative (Composite) Entities


STUDENT(STU_ID, STUD, NAME, STUD_ADDRESS,
PROGRAM)

COURSE (CRS_CODE,CRS_SECTION, COURSE TITLE, DEPARTMENT)

One students can register many courses; (1:M)


One course can be registered by many students. (1:M)à(M:N)

CLASS_ENROLLMENT (CRS_CODE, CRS_SECTION, STUD_ID, PROFESSOR_ID,


CLASS_TIMING)

23 Figure 4.23 - Converting the M:N Relationship into Two 1:M Relationships

24 25

23

Relationships

24 Figure 4.25 - A Composite Entity in an ERD

25 Developing an ER Diagram

§Create a detailed narrative of the organization’s description of operations

§Identify business rules based on the descriptions


§Identify main entities and relationships from the business rules §Develop the initial ERD
§Identify the attributes and primary keys that adequately describe

entities
§Revise and review ERD

You might also like