STRATHMORE UNIVERSITY
FACULTY OF INFORMATION TECHNOLOGY
BACHELOR OF BUSINESS INFORMATION TECHNOLOGY
END OF SEMESTER EXAMINATION
BBT2204: DATABASE SYSTEMS
Date: 12th March 2009 Time: 2 hours
Instructions:
Answer question One and any other two (2) questions of your choice
Question ONE
a) What differentiates a database from a database management system (DBMS)?
3 Marks
b) Why is normalization necessary? 2 Marks
c) Describe the second normal form (2NF)? 2 Marks
Consider the following relation and use the data to answer the questions that follow;
Sales_Order_Table
Stud_No Stud_Surname Course_No Course_Name Course_Cost
1 Maingi BBT2204 Database Systems 10000
2 Victor BBT2204 Database Systems 10000
3 Felix BBT2204 Database Systems 10000
d) Using the above table, answer the questions that follow;
i. Identify 3 anomalies in the above relation. 4 Marks
ii. Identify any repeating group in the relation 2 Marks
iii. Hence or otherwise, normalize the relation to 3NF. 7 Marks
Total: 20 Marks
1
Question TWO
a) What is the ultimate objective of a relational database system 2 Marks
b) Describe the relational database integrity constraints 6 Marks
Consider the information provided below and use it to answer the following questions;
Student
Stud_ No Stud_Surname Stud_DOB
1 Maingi 22-05-1978
2 Victor 24-07-1995
3 Javier 27-08-1996
Class_Reg
Class_No Stud_Reg_No Class_Reg_Date
1A 1 05-05-1999
1C 3 08-09-1999
c)
i. Derive a selection for all students born on or before 10-01-1996 2 Marks
ii. Derive a projection for all non-numeric fields in each relation. 3 Marks
iii. Derive a Cartesian product of the above relations 3 Marks
iv. Derive a natural join from the above Cartesian product, and interpret its meaning
3 Marks
Total: 20 Marks
2
Question THREE
a) What is a transaction? 2 Marks
b) Describe the acidity of a transaction. 6 Marks
Consider the following information and use it to answer the questions that follow;
A customer owning account 801 is transferring Ksh. 139,500 from his account to an
account 998 belonging to one of his business partners. The business partner (owner of
account 998) is also trying to settle a debt of raw materials supplied by one of his
suppliers by issuing a cheque of 150,000. Assume that cheques are debited (credited)
immediately after being deposited.
Assume the bank has a rule that minimum balances cannot go below zero.
Time Transaction 1228 Transaction 1229 Acc 801 Acc 998
(t) (Balances) (Balances)
t1 Begin transaction 322,850 95,675
t2 Read Bal Acc 801 322,850 95,675
t3 Bal Acc 801 = Bal Acc 801 – 322,850 95,675
139,500
t4 Bal Acc 998 = Bal Acc 998 + Begin Transaction 322,850 95,675
139,500
t5 Write Bal Acc 801, write Bal Read Bal Acc 998 183,350 235,175
Acc 998
t6 . Bal Acc 998 = Bal Acc 998 – 183,350 235,175
150,000
t7 Roll back Write Bal Acc 998 322,850 85,175
t8 Commit 322,850 85,175
c) Answer the following questions from the above narrative;
i). What anomaly might have occurred above? Why so? 3 Marks
ii). Rewrite the schedule correctly 4 Marks
iii). What might have caused Transaction 1228 to roll back? 2 Marks
iv). How would serializability have help to avert the anomaly noted in (ii) above?
3 Marks
Total: 20 Marks
3
Question FOUR
a) Define the following terms;
i). Availability 2 Marks
ii). Scalability 2 Marks
Assume Wakulima Bank Ltd is trying to implement a Banking Management system to
streamline its operations country-wide. The bank has branches in all the 70 districts in
Kenya and it intends to integrate all branch operations in a bid to bring into play a
branchless approach to rendering of services to clients. It is believed that this will to a
great improvement of the efficiency and accuracy of their information and services.
After evaluating bids for the above project, Akili Software Developers has emerged as
the most suitable supplier. They are now working with Akili to refine and streamline
requirements for the proposed system. Since most of the bank’s personnel are computer
literate, Wakulima’s directors think that it would be very good to use MS Access as the
database on which the application sits. The Akili development team disagrees with this
proposal and instead, they are proposing MS SQL Server, Oracle or Sybase as the
database management system of choice, and in addition, they propose that Wakulima will
additionally have to recruit and employee a database administrator to manage the
database of the new system. Wakulima’s directors reluctantly agree with the software
team.
b) Answer the following questions from the above narrative;
i) Give reasons why the above system would not possibly run on an MS Access
platform. 5 Marks
ii) Who is a database administrator? What is his role? 3 Marks
Assuming that the Oracle RDBMS was used, the following is code extracted for one of
the procedures for populating the account relation with new records.
Note: Line numbers are provided for guidance and easy debugging.
1. Create or replace procedure
2. (
3. new acc_no ON Number,
4. new acc_surname IN varchar,
5. new_acc_fname IN varchar,
6. new_acc_dob IN date,
7. )
8. as
9. Begin
10. Insert into acc_members (acc_no, acc_surname, acc_fname, acc_add, acc_dob)
11. Values (new_acc_no, new_acc_surname, new_acc_fname, new_acc_dob,
new_acc_add);
12. commit = true;
13. endif;
14. /
c) Identify any errors in the above code, stating in which line number each error occurs.
5 Marks
d) Correct the code, providing the correct script to successfully create the above
procedure. 3 Marks
Total: 20 Marks
4
Question FIVE
The following are the resultant of a normalization exercise by a database designer.
Student
Stud_ No Stud_Surname Stud_DOB
2 Victor 24-07-1995
3 Javier 27-08-1996
4 Rafael 03-10-1998
Class
Class_No Class_Name Class_symbol
1A Alpha α
1B Beta β
1C Chi χ
Class_Reg
Class_No Stud_No Class_Assign_Date
1B 2 12-01-2007
1A 4 13-09-2008
Required;
a) Write SQL scripts to
i). Create the above relations. 3 Marks
ii). Enforce all the primary key (as required) 3 Marks
iii). Enforce a not null constraint on Stud_fname and Stud_DOB 2 Marks
iv). Insert all the data (as shown in the relations) 5 Marks
b) Create code for queries that will achieve the following;
i). List all students enrolled for classes (show all the student fields) 2 Marks
ii). List all students NOT enrolled for any class 2 Marks
iii). Count the number of students enrolled for classes 3 Marks
Total: 20 Marks