Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
FACULTY OF ENGINEERING
DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING
B.Sc. (Hons.) COMPUTER ENGINEERING DEGREE EXAMINATIONS
CPE 502: DATABASE MANAGEMENT SYSTEM
SECOND SEMESTER, 2013/2014 ACADEMIC SESSION
Instructions: This Examination has two sections (A and B).
Answer two questions in Part A and ONLY ONE question in Part B.
Total Time Allowed: 2 Hours
Question One
(a) Define the following terms: entity, attribute, key, relationship, Exec statement in SQL.
[7 marks]
Question Two
(a) Differentiate between relational algebra and relational calculus. [4 marks]
1
(ii) Consider the relations given below with keys underlined
Institution (InsName, street, city)
Staff (staffNo, name, salary, InsName, position, DOB)
propertyForRent (propertyNo, staffNo, rent)
Answer the following queries in relational algebra
(i) Find the names of Staff who work in Akoka campus of the University of Lagos.
[3 marks]
(ii) List the staffNo of Staff who have not rent any property. [3 marks]
(c) Describe the structure of a well formed formulae in relational calculus. [6 marks]
Question Three
(a) Explain the difference between the three storage types volatile, non-volatile and
stable. [6 marks]
2
SECTION B Programming Problems (75 Minutes)
Answer ONLY ONE question
Question Four
Write SQL scripts to:
a) Show the structure of the tables in Table 1. Select all data from the tables. [30 marks]
b) Show the department names, locations, names, job titles, and salaries of employees who
work in location 1800. [15 marks]
c) produce a list of employees showing raise percentages, employee IDs and old salary, and new
salary increase. Employees in department 10 are given a 15% raise while employees in
department 60 are not given. [15 marks]
[Hint: Use CSV files to import data into MySQL table]
Question Five
Write SQL scripts to:
a) show the structure of the table in Tables 2 and 3. Select all data from the table 2. [30 marks]
b) create a trigger function with activation time prior to the update events on the students
table. [15 marks]
c) perform three update events on the students table and select all data from the
students_check table. [15 marks]
[Hint: Use CSV files to import data into MySQL table]