Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

BASIS DATA

Pokok Bahasan Entity-Relationship Diagram (E-R Diagram)


TIK 1. Memodelkan permasalahan di dunia nyata ke dalam model ER
2. Membuat Diagram ER
Setoran Laporan (Format Word) dan ER Diagram (Format Visio)
Zip dengan nama file: Prakt2_NIM.zip
Batas Akhir Setoran Akhir sesi praktikum

1. (Exercise 2.1) explain the distinctions among the terms primary key, candidate key,
and superkey.
Keterangan Primary key Candidate key superkey
Definisi The primary key is A candidate key is a Superkey is a type
an automatic unique attribute that of key attribute used
numbering in a can be a primary when a database
database table that key, and multiple table does not have
is used to uniquely object attributes that a primary key to
identify each row. each have a unique define a database
value in a database table.
table.
Contoh Examples of Examples of examples of super
primary keys in a candidate keys are keys are NIM,
database are user ID, username, address, and major.
hospital code and email.
numbers, student
NIM, and employee
identification
numbers.

2. (Exercise 2.2) construct an E-R diagram for a hospital with a set of parents and a set
of medical doctors. Associate with each patient a long of the various tests and
examinations conducted.

1
3. (Exercise 2.2) A university registars office maintaince data about the following
entities: (a) courses, including number, title, credits, syllabus, and prerequisites; (b)
course offerings, include couse number, year, semester, section number, instructor (s),
timings, and classroom; (c) students, including student-id, name, and program; and (d)
instructor, including identification number, name, department, and title. Further, the
enrollment of students in course and grades awarded to students in each course they
are enrolled for must be appropriately modeled.

Construct an E-R diagram for the registars office. Document all assumpions that you
make about the mapping constraints.
Jawab:
Entities and attributes:
a. Courses:
 Attributes: nomor_matkul, Title, Credits, Prerequisites.
b. Course offerings:
 Attributes: nomor_matkul, Year, Semester, Instructor, Classroom.
c. Students:

2
 Attributes: Student_ID, Student_Name, Program_studi.
d. Instructors:
 Attributes: Instructor_ID, Instructor_Name, Position.

Relationships:
a. Teaches:
 One to many
 One to one
b. Enrolls:
 It connects students with course enrollment.
 Each student can enroll in several courses.
c. Requires:
 It connects courses (prerequisites) and courses.
 Each course can have many prerequisites.

Constraints that may occur:


a. Course prerequisites:
 A course cannot be its own prerequisite.
b. Student enrollment:
 A student can enroll in several courses, however, in course enrollment, there
must be at least one student enrolled.
c. Instructor with courses:
 An instructor can teach several courses, however, the constraint is that an
instructor must be assigned at least one course offering.

Figure 2.29 E-R diagram for Exercise 2.12.

You might also like