Sei sulla pagina 1di 3

DFC2033 - DATABASE SYSTEM

LAB EXERCISE 1
CHAPTER 2 (CLO 3)
NAME
MATRIK NO

:
:

____________________________________
____________________________________

ANSWER ALL QUESTIONS.


Section A (25 marks)
1. Based on the Table 1, write the relation scheme for the Staff table.
(2 marks)
Staff
staffNo fName position
salary branchNo
101
Mahani Manager
20000 B001
102
Ramlah Assistant
10000 B001
103
Azman Manager
30000 B002
104
Azraf
Supervisor 5000
B003
Table 1
2. Based on the Table 2, generate the output for operation below.
(2 marks)
Result LectID, LectName (Department =`JTMK)(LECTURER)
LECTURER
LectID
LectName
F2001
Surihani
F2002
Samad
F2003
Kamaliah
F2004
Suffian

Department
JTMK
JTMK
JKE
JPA
Table 2

Address
Klang
Puchong
Subang Jaya
Kajang

3. Based on the Table 3, write the relational algebra to list employee


number and employee name where salary is greater than RM3000.
(2 marks)
EMPLOYEE
EmpID EmpName Salary
City
1001
Aliah
3000
Kluang
1002
Jannah
1800
Batu Pahat
10003
Sofea
5000
Kota Tinggi
Table 3

DFC2033 DATABASE SYSTEM | JUNE2016 | DNS2A | LE1byshu_haila@jtmk.psp

4. Based on the following tables (Table 4 & Table 5), answer each
question.
STUDENT
ID_Student
Name
Age
Sex
State
1001
Azhar
20
M
Johor
1002
Chinta
19
F
Terengganu
1003
Raju
19
M
Kedah
1004
Yasmin
18
F
Sabah
1005
Dahlia
18
F
Kelantan
Table 4
LECTURER
ID_Lecturer
3120
3333
3123

Lec_Name
Liyana
Nurhani
Azizah

Subject
FP512
FP521
FP613
Table 5

State
Kelantan
Sabah
Kedah

Salary
2300
4000
2000

a.

Write the relation algebra to select the STUDENT tuples whose Age
number is 19 years old and State is Kedah.
(2 marks)

b.

Generate the table to represent the output of each operation below:


i.

RESULT State (STUDENT)

State (LECTURER)
(2 marks)

ii.

RESULT State (STUDENT)

State (LECTURER)
(3 marks)

5. Write the Relational Algebra expression for the following situation:


PATIENT(patient_ID, patient_name, age, ward_No);
DOCTOR(doc_ID, doc_name, address, salary, ward_No);
WARD(ward_No, ward_name, location);
a. Display all patients names which are in ward number 3.
(2 marks)
b. The ward location where patient name Ahmad is treated.
(3 marks)

DFC2033 DATABASE SYSTEM | JUNE2016 | DNS2A | LE1byshu_haila@jtmk.psp

6. Given that :

All the whole numbers from 1 to 10 are to be included.


Set A = { 1 , 4 , 5, 7 , 8 }
Set B = { 2 , 4, 6 , 8 }
SetC = { 3 , 5, 6, 8 }
a. What is the intersection of A and B?

(2 marks)

b. What is set difference of A B?

(2 marks)

c. A (B C)

(3 marks)

Section B (15 marks)


Please convert the following table to the third normal form (3NF) using the
techniques you have learned.

~Question End~

DFC2033 DATABASE SYSTEM | JUNE2016 | DNS2A | LE1byshu_haila@jtmk.psp

Potrebbero piacerti anche