Beruflich Dokumente
Kultur Dokumente
User 2
View 1
View 2
-users view
External
Model
1.
External
level
User n
Model
2.Conceptual
Conceptual
level
-designers view
-h/w independent
-s/w independent
Conceptual Schema
3.Internal
Internal
level
Model
-DBMSs view
-h/w independent
-s/w dependent
Internal Schema
Physical
data
Physical
Model
organization
-h/w dependent
-s/w dependent
View n
ERD
Database
Attribute
Characteristics of entities
Property that explains about entity
Correspondents to fields of a table
Primary key are underline with a straight line
Foreign key are underline with dotted line or an *
Chen Model
attributes are represented by ovals and are connected
to entity rectangle with a line
each oval contains the name of attribute it represents
11
Relationship
Associates between entities/connection between two or
more entities
Logical interaction among the entities in a relational
database
Operate in both directions
Chen Model
12
13
Variations of entity:
i. Weak
ii. Recursive
iii. Composite
iv. Supertype/Subtype
ATTRIBUTE
Types of attribute:
i. Simple attributes
ii. Composite attributes
iii. Multivalued attributes
iv. Derived attributes
14
15
16
17
18
19
employeeMANAGER
employeeSPOUSE
employeeNAME
employeeNO
employeeNAME
employeeNO
1
EMPLOYEE
married
Ah Chong
333
Bazil
444
Sheriz
manage
EMPLOYEE
111
employeeNO
111
222
333
employeeNAME
Ali
Ah Chong
Bazil
444
Sheriz
employeeMANAGER
333
333
333
20
studentNAME
studentID
STUDENT
studentID
200922222
200933333
200944444
STUDENT
studentNAME
courseNAME
enroll
STUDENT_COURSE / ENROLL
studentID
200922222
200922222
200933333
200955555
courseID
ITS232
CSC318
CSC203
ITS232
grade
A+
B+
B
A-
courseID
COURSE
COURSE
courseID courseNAME
ITS232
Database
CSC318
IP
CSC203
OS
22
23
Overlapping:
Subtypes can be
either one or both
of the subtypes
Indicate with:
Gs
24
Disjoint
G
Gs
Overlap
25
26
27
Attributes
Represented by ovals that are connected to entity
with a line
Oval contains of attribute (field) it represents
PK are underlined with straight line
FK are underlined with doted line or *
Example: Entity STUDENT with attributes
name, course, studentID,
address, email
name
email
address
STUDENT
course
studentID
28
29
Attributes types:
i. Simple Attributes
An attribute composed of single component with an
independent existence
Cannot be subdivided into smaller components
Example: gender, martial statues
addressNO
address
addressPOSTCODE
addressTOWN
Simple Attributes
phoneNO
age
STUDENT
name
gender
studentID
30
STUDENT
name
gender
addressPOSTCODE
addressTOWN
Composite Attributes
studentID
31
Attributes types:
iii. Multivalued Attributes
attribute that holds multiple values for each
occurrence of an entity type
Should not be implemented multivalued attributes
in relational database
Can simplifies multivalued attributes by:
a. Create several attributes
b. Create new entity of the original multivalued
attributes components
Example:
phone number handset,office,home
qualification diploma,degree,master
32
Contact hobbies
contac firstna
tid
me
lastnam
e
hobbies
1639
George
Barnes
reading
5629
Susan
Noble
hiking, movies
3388
Erwin
Star
hockey, skiing
5772
Alice
Buck
1911
Frank
Borders
4848
Hanna
Diedrich
cooking, movies
33
Contact hobbies
studenti
d
gend
er
1639
18
Klang
0123456734, 0333721341
5629
18
Temerloh
0199871234, 094602721,
094602721
3388
19
Jerantut
0199112344, 094601234
5772
18
Hulu
Klang
0193448900, 0355446712
1911
18
Besut
0199556301,
4848
18
Machang
0144543331, 095723992
age
address
contactnum
34
STUDENT
studentID
handsetNO
homephoneNO
STUDENT
studentID
has
CONTACT
studentID*
35
Attributes types:
iv. Derived Attributes
An attributes that represents a value that is derived
from the value of related attribute or set of
attributes, not necessarily in the same entity type.
Need not be physically stored within database
Example:
age
36
37
Defining Relationships:
39
41
A
PK
FK
FK
EID
Name
111
Ikhsan
222
Eizan
333
Nawal
Super_
EID
111
444
Fairuz
222
Unary Relationship Type R, we identify the relation A represents the
entity type involves in this relationship. Include in this relation one more
time as foreign key the primary of itself. The two keys (primary key and
foreign key) are the same but they represents two entities of different
roles relate to this relationship.
42
A
B
A
B
R
A
B
1-N Binary Relationship Type: For each 1-N Binary Relationship Type
R, identify two relations A and B correspond to two entity types
participating in R. A represents the entity type at 1-side and B
represents the entity type at N-side. Include the primary key of A as
the foreign key in B. This foreign key represent the relationship type R.
44
A
B
S
M-N Binary Relationship Type: For each M-N Binary Relationship
Type R, identify two relation A, B represent two entity type participating
in R. Create a new relation S to represent R. Include in S as foreign
keys the primary keys of A and B and all the simple attributes of R. The
combination of primary keys of A and B will make the primary key
of S.
45
b.1:M
STUDENT
c.M:N
STUDENT
under
PROGRAM
register
COURSE
47
48
STUDENT
M
(1,9)
N
register
(0,35)
COURSE
49
LECTURER
1
(0,3)
M
teach
(1,1)
COURSE
50
51
. Existence dependence
Entity exists in database only when it is associated
with another related entity occurrence
. Existence independence
Entity can exist apart from one or more related
entities
Sometimes such an entity is referred to as a strong
or regular entity
b.Strong Relationship
Existence dependence
PK of related entity contains PK component of parent
entity
Identifying Relationship
53
54
55
56
57
1
(0,3)
M
teach
(1,1)
COURSE
cardinality
participation
Chen Model
Entity
Weak Entity
Composite Entity
Relationship line
Relationship
Option Symbol
One (1) Symbol