Professional Documents
Culture Documents
Chapter 3 Apply Erd
Chapter 3 Apply Erd
Design
LECTURER : PN. NOOR HAFIZZAH | DEC 2020
Chapter 3 :
Entity-Relationship (E-R) Model &
Normalization
Synopsis
DATABASE DESIGN course engages students to analyze
business scenarios and create a data model - a conceptual
representation of an organization’s information. Students
implement their database design by creating a physical database
using SQL (Structured Query Language). Basic SQL syntax and
the rules for constructing valid SQL statements are reviewed.
This course culminates with a case study that challenges
students to design, implement, and demonstrate a database
solution for a business or organization.
COURSE LEARNING
OUTCOMES
CLO
Upon completion of this course, students should be able to:
CLO 1 : Apply fundamental of DBMS, relational data model
and normalization concepts in database development process.
( C3, PLO 2 )
CLO 2 : Show a well-structured database using the database
query to manipulate a database with an appropriate
commercial Database Management System (DBMS) in solving
an organization’s requirements. ( P2, PLO 3 )
3.2 Apply E-R Diagrams (ERD) in database development
PRODUCT must
Each be classified by one and only one
PRODUCT TYPE
PRODUCT TYPE may
Each classify one or more
PRODUCTs
34
Relate (connect or join) entities by applying
the rules of cardinality and optionality.
Examples….
Business Scenario 1
Business Scenario 2
A relationshipcan join one entity to itself. Examine the
following scenario:
“We need to keep track of our employees
and their managers. Every employee has
one manager, including the managing
director who manages him/herself. Each
manager can manage several employees.”
Since managers are also employees, both are
listed in the same entity: EMPLOYEE.
RELATIONSHIP
1. An EMPLOYEE manages EMPLOYEEs
2. An EMPLOYEE is managed by one
EMPLOYEE
Interpret relationship cardinality
What is Cardinality in a Relationship?
Cardinality measures the quantity of something. In a relationship,
it determines the degree to which one entity is related to another
by answering the question, “How many?”
For example:
• How many jobs can one employee hold? One job only? Or more than one
job?
• How many employees can hold one specific job? One employee only? Or
more than one employee?
Note: The cardinality of a relationship only answers whether the
Interpret relationship cardinality
What is Cardinality in a Relationship?
a) One to one ( 1:1 )
b) One to many ( 1:M )
c) Many to many ( M:N )
Cardinality.This specifies the number of each entity that is involved in the relationship.
There are 3 types of cardinality for binary and unary relationships:
2. One to many (1:M). For example, 1 manager manages many employees, each
employee is managed by 1 manager.
3. Many to many (M:N). For example, Each students take many modules, each module
is taken by many students.
How many is many? It doesn't matter! If it's 0, 10 or 100, the way you implement the
relationship is the same.
Relate entities by applying the rules of cardinality and
optionality.
The Components
1. EACH
2. Entity A
3. OPTIONALITY (must be/may be)
4. RELATIONSHIP NAME
5. CARDINALITY (one and only one/one or more)
6. Entity B
Since each relationship has two sides, first read
relationship from left to right (or top to bottom,
depending on the ERD layout).
read relationship from right to left
1.EACH
2.Entity A
3.OPTIONALITY (must be/may be)
4.RELATIONSHIP NAME
5.CARDINALITY (one and only one/one
or more)
6.Entity B
Now we read the second relationship
from right to left.
Now bring it together.
1.EACH
2.Entity A
3.OPTIONALITY (must be/may be)
4.RELATIONSHIP NAME
5.CARDINALITY (one and only
one/one or more)
6.Entity B
Test your knowledge
47
Try It / Solve It
1. The goal of this practice is to read a relationship. Which text corresponds to
the diagram?
eBook - E N T I T Y R E L A T I O N S H I P ( E R ) M O D E L I N
G pg.127
Steps to Develop ER Diagram:
1 :
EP Y 2 :
T
S NTI F E P Y A W
E T Y ST NTIF HIP: DR
ID TI E NS 3
R D
EN ID TIOTEP E E
L A S TH
RE
STEP 1 : IDENTIFY ENTITY
Example - Entities
A university consists of a number of departments.
Each department offers several courses. A number
of modules make up each course. Students enrol in
a particular course and take modules towards the
completion of that course. Each module is taught
by a lecturer from the appropriate department, and
each lecturer tutors a group of students.
STEP 2 : IDENTIFY
RELATIONSHIP Example - Relationships
A university consists of a number of departments.
Each department offers several courses. A number
of modules make up each course. Students enrol in
a particular course and take modules towards the
completion of that course. Each module is taught
by a lecturer from the appropriate department, and
each lecturer tutors a group of students.
STEP 3 : DRAW THE ERD
Example - ER Diagram
Entities:Department, Course, Module,
Lecturer, Student
Relationship: Each department offers several courses
Relationship: A number of modules make up
each courses
Relationship: Students enrol in a
particular course
1 1
M M
1 M M N
71