2
Yang sudah dipelajari
3
Outline
3. Konsep-konsep model ER
5. Pembuatan diagram ER
4
4. Konsep model ER: relationship, weak entity
Data pribadi PEGAWAI meliputi SSN, name (first name, middle name, last
EMPLOYEE
name), address, salary, sex, birthdate Name (EName, MInit, LName), SSN, Sex, Address,
Salary, BirthDate, Department, Supervisor,
➔ Tiap EMPLOYEE bekerja pada satu DEPARTMENT, namun dapat {Workson(Project, Hours)}
terlibat pada beberapa PROJECT, yang tidak harus di department
yang sama dengan pegawai.
5
4. Konsep model ER: relationship, weak entity
DEPARTMENT EMPLOYEE
Name, Number, Locations, Manager, ManagerStartDate Name (EName, MInit, LName), SSN, Sex, Address, Salary,
BirthDate, Department, Supervisor, {Workson (Project, Hours)}
PROJECT DEPENDENT
Name, Number, Location, ControllingDepartment Employee, DependentName, Sex, Birthdate, Relationship
6
4. Konsep model ER: relationship, weak entity
Relationship
Sebuah relationship menghubungkan dua/lebih entity yang berbeda dengan makna tertentu.
Contoh:
➔ EMPLOYEE John Smith works on the ProductX PROJECT
➔ EMPLOYEE Franklin Wong manages the Research DEPARTMENT.
Contoh:
➔ WORKS_ON relationship type in which EMPLOYEEs and PROJECTs participate
➔ MANAGES relationship type in which EMPLOYEEs and DEPARTMENTs participate
7
4. Konsep model ER: relationship, weak entity
Derajat dari Relationship Type adalah jumlah Entity Types yang berpartisipasi pada
relationship ini (Binary, Ternary, N-nary)
Satu entity type dapat berpartisipasi pada lebih dari satu relationship type Relationships
memiliki hubungan directional (arah tertentu):
8
4. Konsep model ER: relationship, weak entity
Binary Relationship
9
4. Konsep model ER: relationship, weak entity
Ternary Relationship
10
4. Konsep model ER: relationship, weak entity
Structural Constraints
◆ Double link untuk total participation: minimal ada 1 entity set yang terlibat pada
relationship.
◆ Single link untuk partial participation: diperbolehkan apabila tidak ada entity set
yang terlibat pada relationship
11
4. Konsep model ER: relationship, weak entity
12
4. Konsep model ER: relationship, weak entity
13
4. Konsep model ER: relationship, weak entity
14
4. Konsep model ER: relationship, weak entity
Structural Constraints
Total participation
Total participation
Total participation
Partial participation
1-1 relationship
1-N relationship
15
4. Konsep model ER: relationship, weak entity
Recursive Relationship
Satu entity berpartisipasi lebih dari 1 kali dalam recursive relationship, dengan role yang berbeda
16
4. Konsep model ER: relationship, weak entity
Role
Role
Recursive relationship
17
4. Konsep model ER: relationship, weak entity
Attribute untuk
WORKS_ON
18
4. Konsep model ER: relationship, weak entity
Menentukan Relationship
Uji kombinasi dari 2 entity, lihat apakah ada kemungkinan relationship diantara keduanya.
DEPARTMENT ? PROJECT
EMPLOYEE ? DEPARTEMENT
19
4. Konsep model ER: relationship, weak entity
Weak entity harus berpartisipasi dalam sebuah identifying relationship type dengan suatu
owner atau identifying entity type
20
4. Konsep model ER: relationship, weak entity
Attribute untuk
WORKS_ON
21
4. Konsep model ER: relationship, weak entity
Harus memenuhi
➔ min max, min 0, max 1
22
?
Q&A