Bsc(Hons) Web Technologies Cohort: BWT/11/FT Examinations for 2012-2013 / Semester 2 MODULE: ADVANCED WEB DATABASE MANAGEMENT SYSTEM MODULE CODE: DBT2105 Duration: 2 ½ Hours Instructions to Candidates: 1. Answer ALL questions. 2. Questions may be answered in any order but your answers must show the question number clearly. 3. Always start a new question on a fresh page. 4. All questions carry equal marks. 5. Total marks 100. This question paper contains 5 questions and 6 pages. Page 1 of 6
QUESTION 1: (20 MARKS) One of the tasks a database management system must perform is to ensure that the data is still intact in the face of software and hardware failure. This task is known as recovery. (a) Describe the three basic steps involved in recovery. (b) Describe the three types of failure in a database system. Support your answer with appropriate example. (6 Marks) (c) Discuss how the log file (or journal) is a fundamental feature in any recovery mechanism. (d) Explain what is meant by forward and backward recovery and describe how the log file is used in forward and backward recovery? (e) What is the significance of the write-ahead log protocol? (f) How do checkpoints affect the recovery protocol? (4 Marks) Page 2 of 6
QUESTION 2: (20 MARKS) A distributed database is defined as a collection of multiple logically interrelated database which are physically distributed over a computer network (a) Give any three advantages of implementing a distributed database system. (b) Provide any three difficulties that database designer has to face when implementing a distributed database system. (c) The components of a Distributed Database include the following: Network Processor, Remote data processor, Data dictionary, and local data processor. Explain the function of each of the above components. (4 Marks) (d) Differentiate between a Homogeneous Distributed Database and a (e) Heterogeneous Distributed Database. Briefly discuss why data fragmentation could be useful in such distributed database systems, and explain each of the following fragmentation rules: Completeness Reconstruction Disjointness (8 Marks) Page 3 of 6
QUESTION 3: (20 MARKS) Consider the following database relations: STUDENT (S#, SNAME, YEAR-OF-ENTRY, ADDRESS, PHONE) COURSE (C#, COURSETITLE, LEVEL, LECTURER) GRADE(S#, C#, COURSEWORK, EXAM, OVERALL) and the following query SELECT STUDENT.SNAME, OVERALL FROM STUDENT, GRADE WHERE GRADE.S# = STUDENT.S# AND GRADE.C# = QC303 AND GRADE.OVERALL > 9 Assuming that: i.) The STUDENT relation contains 2000 records; ii.) The GRADE relation contains 1000 records. Among them only 150 are for the course QC303 which is the C#, and of which 100 with OVERALL grade above 9; iii.) It is possible to hold up to 150 records in the main memory. Answer the following questions: (a) Choose two possible methods to evaluate the above query. Show all the steps in the evaluation and calculate the number of tuple input/output operations required for each step. (12 Marks) (b) Having considered a specific query as above, discuss now how query optimization is generally implemented in a relational database system. Your discussion should focus on describing various stages involved in an optimization process. (8 Marks) Page 4 of 6
QUESTION 4: (20 MARKS) (a) Differentiate between database security and database integrity (b) Database security involves measures to avoid loss of privacy and loss of confidentiality. Explain what is meant by the above terms. (4 Marks) (c) In the context of database security explain how the following database features help to enforce security in the database system: (i) Authorisation (ii) Access Control (iii) Views (d) Differentiate between a Discretionary Access Control and a Mandatory Access Control. Which one is more rigid to the modification of the privilege assigned to users? (5 Marks) (e) Assuming that the following view exist in your database schema: CREATE VIEW View1 AS SELECT S_id, S_name, Status, City FROM Suppliers WHERE City = Paris Write an appropriate SQL Code to give access right to two users Mark and Spencer so that they can Insert, Update, Delete and Retrieve all the data in the above view. Put a control so that both Mark and Spencer can only update the supplier name and the status of the suppliers. Page 5 of 6
QUESTION 5: (20 MARKS) (a) (b) In the context of concurrency control for a multi-transaction database system, briefly discuss the concept of lock and deadlock, and their relationship. (5 Marks) Consider the following two interleaved transactions A and B which might occur in a database system for a bank. Mr Smith s bank account, with an initial balance of $1000, is being updated simultaneously by two transactions A and B in the order shown below: 1. Transaction A retrieves the account balance 2. Transaction A transfer out $300 from the account and updates the account balance. 3. Transaction B retrieves the account balance. 4. Transaction B transfer $200 into the account 5. Transaction A executes a rollback. 6. Transaction B commits the transaction. Answer the following questions (i) Show the step-by-step changes to the account balance and the final balance of the account, if transaction A and B were performed according to the sequence shown above. (ii) Show the step-by-step changes to the account balance and the final balance of the account, if transactions A and B were performed in a serial sequence (i.e., Transaction A completes all its operations before Transaction B starts). (iii) Identify the type of concurrency problem occurred in the transaction sequence used for (i) above, and explain how the problem arises. (iv) Provide a step-by-step solution using locking to show how the two transactions would be executed, if appropriate concurrency control were applied to the system. (7 Marks) ***END OF QUESTION PAPER*** Page 6 of 6