Relation Himpunan entity Relationship Atribut 3 Entity 1 Atribut 1 Hubungan antara dua atau lebih entity
Ternary Relationship Student NIM Name Room Subject SubjectId Name ClassId Class Lecturer NIP Name
Ternary Relationship CREATE TABLE Class (NIM CHAR(10), SubjectId CHAR(6), ClassId CHAR(7), Room CHAR(6), PRIMARY KEY (ClassId), FOREIGN KEY (NIM) REFERENCES Student, FOREIGN KEY (SubjectId), REFERENCES Subject)
Role Name NIM Student Coordinate Subordinate CoordinateBy
Key Constraint since Faculty FacId Employee NIP Name manages Hubungan antara dua atau lebih entity CREATE TABLE manages (FacId CHAR(1), NIP CHAR(10), since DATE, PRIMARY KEY (FacId), FOREIGN KEY (FacId) REFERENCES Faculty, FOREIGN KEY (NIP), REFERENCES Employee)
Key Constraint since Faculty FacId Employee NIP Name manages Faculti hanya dimanages oleh maksimal satu employee CREATE TABLE FacMan (FacId CHAR(1), Faculty CHAR(20), NIP CHAR(10), since DATE, PRIMARY KEY (FacId), FOREIGN KEY (NIP), REFERENCES Employee) NIP boleh bernilai null
Participation Constraint since Faculty FacId Employee NIP Name manages Total participation partial participation workIn
Participation Constraint CREATE TABLE FacMan (FacId CHAR(1), Faculty CHAR(20), NIP CHAR(10) NOT NULL, since DATE, PRIMARY KEY (FacId), FOREIGN KEY (NIP), REFERENCES Employee, ON DELETE NO ACTION) NIP tidak boleh bernilai null Record Employee bisa dihapus jika managernya telah diganti
Weak Entity* polis cost Name Dependents name age NIP Employee Garis tebal Weak entity CREATE TABLE depPolis (name CHAR(20), age INTEGER, cost REAL, NIP CHAR(10) NOT NULL, PRIMARY KEY (name,NIP), FOREIGN KEY (NIP), REFERENCES Employee, ON DELETE CASCADE) Dependents adalah Weak entity Dependents dihapus jika Employee dihapus
Hirarki Class Name NIP Employee ISA permanent level Room PartTime hoursWork jobDesc
Ternary Relationship Room Subject SubjectId Name Name ClassId NIP Lecturer Student NIM Name
Agregasi Subject subId subject credit semester Class room time day classId Lecturer nip name Agregate take mark Student nim name ipk
Desain Konseptual dengan Model ER Mengerti institusi yang akan dimodelkan dan informasi yang akan disimpan Pilihan Konsep dimodelkan sebagai entity atau atribut Konsep dimodelkan sebagai entity atau relationship Relationship yang bagaimana? Ternary atau binary? Perlukah agregasi
Entity atau Atribut Address Atribut Entity - Satu address per employee - Cukup sebagai kesatuan string Atribut Address - Lebih dari satu address per employee - Diuraikan menjadi jalan, kota, kode pos Entity Faculty FacId Employee NIP Name workIn2 from to NIM FacId from to 132226958 1 1/1/91 2/2/92 2 3/3/93 3/5/94 132224246 4 3/1/92 12/12/92 5/7/95 3/5/96
Entity atau Atribut Name FacId NIP Faculty workId Faculty workIn3 Employee Duration from to
Entity dan Relationship FacId Faculty dBudget NIP Name since budget manages2 Faculty Employee
Entity dan Relationship FacId Faculty NIP Name budget manages3 Faculty Employee since MgrAppt apptNum dBudget
Binary atau Ternary Relationship Name Dependents name age NIP menanggung Employee polisId cost Polis Polis hanya dimiliki oleh satu orang Tiap polis dimiliki oleh seorang employee Dependent adalah weak entity konjungsi dengan policeID Key constraint Total participation Binary relationship
Binary atau Ternary Relationship Name Dependents name age NIP Employee Purchaser Beneficiary Polis cost polisId
Binary atau Ternary Relationship CREATE TABLE Polis (polisId CHAR(10), cost REAL, NIP CHAR(9) NOT NULL, PRIMARY KEY (polisId), FOREIGN KEY (NIP) REFERENCES Employee, ON DELETE CASCADE) CREATE TABLE Dependents (pname CHAR(20), age INTEGER, polisId CHAR(10), PRIMARY KEY (pname, polisId), FOREIGN KEY (polisId) REFERENCES Polis, ON DELETE CASCADE)
Binary atau Ternary Relationship CREATE TABLE Dependents (pname CHAR(20), NIP CHAR(9), age INTEGER, polisId CHAR(10), PRIMARY KEY (pname, polisId, NIP), FOREIGN KEY (polisId,NIP) REFERENCES Polis, ON DELETE CASCADE)
Binary atau Ternary Relationship(Parts) qty contracts Departments Supliers Parts sid pid S1 P1 S2 P2 pid did P1 D1 D2 P2 sid did S1 D1 S2 D2 sid pid did qty S1 P1 D1 10 S2 D2 20 P2 30 40
Agregation atau Ternary Relationship Subject subId subject credit semester Class room time day classId Lecturer nip name take mark Student nim name ipk
Agregation atau Ternary Relationship Subject subId subject credit semester Lecturer nip name room time take mark day Student nim name ipk
Constraint pada Model ER Kebijakan untuk Kasus Parts Department tidak boleh memesan Part berbeda dari satu Suplier Department harus membuat Contract dengan Suplier tunggal Next on Functional and Inclusion Dependency …