BasisData W2S02 Prak Relational Data Model

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

Institut Teknologi Del

Sitoluama, Laguboti, Toba Samosir

Session Date : September 2020


Semester : Gasal
Subject : Basis Data
Week/Session : 2/2
Topic : Relational Model
Activity : Praktikum
Duration : 120 minutes
Rules : Personal
Deliverable : Hardcopy
Dead line : End of Session
Place to deliver : TA
Objective : Dapat memahami Relational Model
Lecturer : PAT, IUS, JUN
Instructor : DES
The diagram below shows referential integrity constraints for the COMPANY relational
database schema

1|ISS2101- Basis Data- PAT


This is the relational schema with primary key attributes underlined.

The following is a database state of UNIVERSITY relational database schema

The instructor relation. The course relation.

The prereq relation. The department relation.

The section relation.

2|ISS2101- Basis Data- PAT


The teaches relation.

Discuss all integrity constraints violated by each operation, if any, and the different ways of
enforcing these constraints.

Contoh:

1. Insert <10102 ’Cecilia’, ‘Finance’, 28000> into INSTRUCTOR


Result: Sukses karena tidak melanggar integritas apapun

2. Insert <12121 ’Angelica’, ‘Finance’, 28000> into INSTRUCTOR


Result: Tidak berhasil, karena kode 12121 sudah dimiliki oleh Wu. Pada relasi instructor
atribut ID adalah Primary key sehingga tidak boleh ada yang sama.

Tugas anda:

1. Insert <76767 ’Frank’, ‘Histories’, 28000> into INSTRUCTOR


Result:

2. Insert <96767 ’Albert’, ‘Music’, two> into INSTRUCTOR


Result:

3. Update the salary of the EMPLOYEE tuple with ID = 12121 to 12000


Result:

4. Insert <00001 ’EE-181’, 2,‘Fall’, 2009> into TEACHES


Result:

5. Insert <’Finance’, ’Watson’, 3000> into DEPARTMENT


Result:

3|ISS2101- Basis Data- PAT


6. Insert <’Accounting’, ’Watson’, 30000> into DEPARTMENT
Result:

7. Insert <’Language’, ’Watson’, ‘2000’> into DEPARTMENT


Result:

8. Delete the DEPARTMENT tuple with dept_name= ‘Biology’


Result:

9. Delete the COURSE tuple with course_id = ‘PHY-101’


Result:

10. Delete the INSTRUCTOR tuple with ID= ‘10101’


Result:

11. Delete the INSTRUCTOR tuple with ID= ‘58583’


Result:

12. Update the dept_name of the INSTRUCTOR tuple with ID = ‘10101’ to ‘Histories’
Result:

13. Update the Course_id of the TEACHES tuple


with (ID = ‘10101’ and Course_id= ‘CS-347’) to ‘CS 101’
Result:

14. Update the Course_id of the TEACHES tuple


with (ID = ‘10101’ and Course_id= ‘CS-347’ )to ‘MU-199’
Result:

15. Delete the INSTRUCTOR tuple

------------------------------------------------EOF------------------------------------------------

4|ISS2101- Basis Data- PAT

You might also like