Anda di halaman 1dari 3

KELANA JAYA STUDY CENTRE 18-5 PLAZA CCL, JALAN PERBANDARAN SS6/12 KELANA JAYA URBAN CENTRE 47301

KELANA JAYA

FINAL EXAMINATION JUNE 2006


mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm COURSE TITLE COURSE CODE DATE/DAY TIME/DURATION : : : : DATABASE CSB2014/CSD2014 1 AUGUST 2006/TUESDAY 8.30 AM 11.00 AM / 2 HOURS 30 MINUTES

mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm INSTRUCTIONS TO CANDIDATES:


1. 2. 3. 4. 5. This Question Booklet consists of TWO (2) Sections, Section A and B. Answer ALL Questions in Section A and ALL Questions in Section B. Answer ALL questions in Section A and Section B in the Answer Booklet. Candidates are not allowed to bring into the examination hall/room any form of written materials or electronic gadget except for stationery that is permitted by the Invigilator. Students who are caught breaching the Examination Rules and Regulation will be charged with an academic dishonesty, and if found guilty of the offence, the maximum penalty is expulsion from the University.

(This Question Paper consists of 3 Printed Pages)

*** DO NOT OPEN THE QUESTION PAPER UNTIL YOU ARE TOLD TO DO SO ***

Database (CSB2014/CSD2014) June 2006 Final Examination

CONFIDENTIAL

SECTIONA There are FOUR(4) questions in this part. Answer ALL questions. 1. Distinguish between the terms Data, Database and Database Management System.

(20 Marks)

(3 marks) 2. List any TWO (2) disadvantages of using the traditional file processing approach for storing and accessing data and explain how database management systems (DBMSs) overcome these limitations. (8 marks) What is an associative entity? Explain with an example. (6 marks) 4. What are the types of numbers that can be stored in each of the following datatype declarations? a. NUMB ER(5) b. NUMBER(5,2) c. NUMBER (3 marks)

3.

SECTION B There are THREE (1) questions in this section. Answer ALL questions. 1.

(80 Marks)

Draw an Entity-Relationship (E-R) diagram for the UNITAR database which follows the following business rules: UNITAR has a number of different people working in it. It needs to maintain the information of the following attributes for all the people : Identity Number (ID ), Name, Address, Telephone. A person can either be a student, a staff or an alumnus . A student has a CGPA and one or more hobbies he likes to pursue. A staff has one or more dependents (his/her children). Dependents have a name and an age attribute. An alumnus has one or more degrees which he has taken from UNITAR. A staff is associated with a department with each department being characterized by a dept. number, dept. name and head. A staff personnel is categorized as being either an academic staff or non-academic staff. An academic staff has one or more research areas he likes to pursue. A non-academic staff has one or more skills. A student takes many courses depending on the program in which he is enrolled. A course has a course code, course name and is supervised by a lecturer who is an academic staff. UNITAR also has a number of faculties in it with each faculty being characterized by a faculty name and location . A faculty offers different programs and has different departments within it. A faculty is headed by a dean who is an academic staff. (Note : For determining the cardinality of relationships, use the business rules of UNITAR as it stands today). (20 marks)

2.

Based on the E-R model in question number 1 above, draw the relations(tables) for the following entities: Person Student Alumnus Staff Faculty Department Show the primary key foreign key relationships among them . (10 marks)

Database (CSB2014/CSD2014) June 2006 Final Examination

CONFIDENTIAL

3.

Consider the following two tables:

EMP TABLE Column Name EMPNO ENAME JOB MGR SAL COMM DEPTNO

DataType NUMBER(4) VARCHAR2(20) CHAR(10) NUMBER(4) NUMBER(9,2) NUMBER(7,2) NUMBER(2)

Constraint PRIMARY KEY NOT NULL REFERENCES EMPNO

REFERENCES DEPT(DEPTNO)

DEPT TABLE Column Name DEPTNO DNAME LOC

DataType NUMBER(2) VARCHAR2(20) VARCHAR2(20)

Constraint PRIMARY KEY NOT NULL

Write the SQL commands to do the following: a. Create the above two tables (along with the appropriate constraints). (6 marks) b. Select the employee number, employee name, job, department number and departme nt name of all employees who are MANAGERS. (5 marks) Create a new table named MY_EMP which has the same structure as table emp but no data. (3 marks) Insert all rows in table MY_EMP from table emp for which the deptno is either 10 or 20. (3 marks) e. Grant select privilege on table emp to user1 and allow him to give further grants. (4 marks) f. List the total salary, maximum and minimum salary and the average salary of employees job wise for department number 10. (5 marks) List the name of the employee drawing the highest salary. (4 marks) h. List the job with highest average salary. (5 marks) i. List the highest paid em ployee of each department. (5 marks) j. Write a PL/SQL procedure to delete an employee from the EMP table. The steps of the procedure are as follows: a. The employee number is passed to the procedure as a parameter. b. The employee number and name of the employee in the deleted record are saved in another table called FORMER_EMP. c. The record is deleted from the EMP table. d. The delete_date column in the FORMER_EMP table is updated with the current system date. (10 marks) *** END OF QUESTION PAPER ***

c.

d.

g.

Anda mungkin juga menyukai