Академический Документы
Профессиональный Документы
Культура Документы
CLO1 Explain the basic concepts of database model using entity-relationship diagram and
translating completed data models by applying normalization technique in logical
database designs. (C4)
10
stu_email
stu_lname
stu_phone
STUDENT
11
12
COMPOSITE
Attribute that can be further subdivided to additional
attributes
Example : ADDRESS can be subdivided into street, city,
state and zip code
SIMPLE / ATOMIC
Attribute that cannot be subdivided.
Example : AGE, GENDER, MARITAL STATUS
ec601 database system
13
SINGLE VALUE
Attribute that can have only a single value.
Example : IC, MATRIX NO
MULTI VALUE
Attribute that can have multi value.
In Chen Model, multi valued attributes are shown by a double line oval
connecting the attribute to the entity.
Example : CAR COLOR
CAR
color
ec601 database system
14
DERIVED
Attribute whose value may be calculated from other
attributes.
It need not be physically stored within the database,
instead, it can be derived by using an algorithm.
Example : EMP_AGE can be calculated with
EMP_DOB
15
TEACHER
TEACHER
ic_no
subjects
Ic_no
Single Value
Attribute
CIRCLE
radius
Multivalued
Attribute
Derived
Attribute
TEACHER
address
street
ec601 database system
p_code
state
16
Composite
Attribute
area
DOMAIN
GPA
GENDER
M or F
17
18
19
21
supervision
EMPLOYEE
PROFESSOR
Unary/Recursive
Relationship
CONTRIBUTOR
Binary
Relationship
CFR
FUND
ec601 database system
teaches
Ternary
Relationship
22
RECIPIENT
CLASS
23
STRONG RELATIONSHIP
Also known as an identifying relationship
Exists when the related entities are existence-dependent.
In database design perspective, a strong relationship between
two entities exists whenever the primary key of the related
entity contains a primary key component of the parent entity.
Example :
COURSE (CRS_CODE, DEPT_CODE, CRS_CREDIT)
CLASS (CRS_CODE, CLASS_SECTION, CLASS_TIME)
#: The CRS_CODE in CLASS is also a foreign key to the COURSE
entity.
ec601 database system
24
WEAK RELATIONSHIP
25
Strong
relationship
ec601 database system
Weak
relationship
26
1
PAINTER
paints
PAINTING
27
Optional Relationship
If one entity occurrence does not require a corresponding entity
occurrence in a particular relationship
The existence of an optional indicates that the minimum
cardinality is 0 for the optional entity.
An optional relationship between entities is shown by drawing a
small circle (o) on the side of the optional entity.
Mandatory Relationship
If one entity occurrence requires a corresponding entity
occurrence in a particular relationship.
The existence of an mandatory indicates that the minimum
cardinality is 1 for the optional entity.
Example :
Optional Relationship
An Employee may or may not be assigned to a
Department
A Patient may or may not be assigned to a Bed
Mandatory Relationship
Every Course must be taught by at least one
Teacher
Every mother have at least a Child
1
PROFESSOR
CLASS
teaches
mandatory
optional
Example :
Suppose that Tiny College employs some professors who conduct
research without teaching classes. If we examine the PROFESSOR
teaches CLASS relationship, it is quit possible for a PROFESSOR not to
teach a CLASS. Therefore, CLASS is optional to PROFESSOR. On the
other hand, a CLASS must be taught by a PROFESSOR. Therefore
PROFESSOR is mandatory to CLASS.
Cardinality Constraints
Maximum Cardinality
The maximum number
Example :
CONNECTIVITIES
PROFESSOR
CLASS
teaches
(1,4)
(1,1)
CARDINALITIES
MODEL
ENTITIES &
ATTRIBUTES
CHOOSE
PRIMARY
KEYS
MODEL
RELATION
DETERMINE
SHIP
LITIES
34
CARDINA
CHECK THE
MODEL
A Simple Example
Identify entities
One approach to this is to work through the information and highlight those
words which you think correspond to entities.
Identify entities
DEPARTMENT
PROJECT
EMPLOYEE
SUPERVISOR
Identify Attributes
DEPARTMENT
department_
name
project_name
EMPLOYEE
employee_
name
PROJECT
employee_
no
project_no
SUPERVISOR
supervisor_
name
supervisor_
no
DEPARTMENT
department_
name
project_name
EMPLOYEE
employee_
name
PROJECT
employee_
no
project_no
SUPERVISOR
supervisor_
name
supervisor_
no
Identified Relationships
Names placed in the cells are meant to
capture/describe the relationships. So you can use
them like this
A Department is assigned by an employee
A Department is run by a supervisor
An employee works on a project
A supervisor runs a department
EMPLOYEE
works
on
PROJECT
DEPARTMENT
run by
SUPERVISOR
DEPARTMENT
is
assign
EMPLOYEE
DEPARTMENT
run by
SUPERVISOR
works
on
PROJECTS
is
assign
EMPLOYEE
43
Identify Cardinality
Supervisor
Each department has one supervisor.
Department
Each supervisor has one department.
Each employee can belong to one or more departments
Employee
Each department must have one or more employees
Each project must have one or more employees
Project
Each employee can have 0 or more projects.
(1,1)
run by
(1,1)
SUPERVISOR
(1,N)
is
assign
(1,N)
EMPLOYEE
(1,N)
works
on
45
(0,N)
PROJECTS
ERD Diagram
DEPARTMENT
(1,1)
run by
(1,1)
SUPERVISOR
(1,N)
Department
name
Supervisor
name
is
assign
(1,N)
EMPLOYEE
employee_
name
ec601 database system
(1,N)
works
on
Employee
no
(0,N)
project_
name
46
Supervisor
no
PROJECTS
Project no
SUMMARY of ER
DIAGRAM NOTATION
SYMBOL
MEANING
ENTITY/ ENTITY TYPE
RELATIONSHIP TYPE
47
SUMMARY of ER
DIAGRAM NOTATION
SYMBOL
MEANING
ATTRIBUTE
KEY ATTRIBUTE
MULTIVALUED ATTRIBUTE
DERIVED ATTRIBUTE
COMPOSITE ATTRIBUTE
ec601 database system
48