23.10.2014 Views

2007 Exam Paper

2007 Exam Paper

2007 Exam Paper

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

UNIVERSITY OF ABERDEEN SESSION 2006-<strong>2007</strong><br />

<strong>Exam</strong>ination in CS5035 (Introduction to Database Systems)<br />

16 January <strong>2007</strong> (15:00 – 17:00 Hrs)<br />

Answer any Three questions.<br />

Use a separate answer book for each question.<br />

Each question is worth 25 marks; the marks for each part of a question are shown in brackets.<br />

1. (a) ‘Spreadsheet software (such as Microsoft Excel) offers a simple solution for storing data’. Critically evaluate the<br />

above statement in comparison to storing data using a DBMS (such as Microsoft Access)? (3)<br />

(b) Describe what you understand by the term ‘Relational Model’ and identify the main components of a relational<br />

model. (5)<br />

(c) In the context of relational databases, explain the term ‘referential integrity’. (2)<br />

(d) Transform the following EER model fragment representing the relationship between MusicConcert and Artists<br />

into a set of relations, explaining in detail the steps you have followed. (5)<br />

MusicConcert<br />

CID<br />

CTitle<br />

1..1 1..*<br />

Artists<br />

AID<br />

lName<br />

fName<br />

(e) Transform the following EER model fragment representing the relationship between Movie and Cinema into a set<br />

of relations, explaining in detail the steps you have followed. (5)<br />

Movie<br />

MID<br />

MTitle<br />

1..* 1..*<br />

Cinema<br />

CID<br />

Address<br />

(f) What is meant by third normal form (3NF)? <strong>Exam</strong>ine the following table to check if it is in 3NF. If yes, explain<br />

your answer. Otherwise convert the table into 3NF. (Assume CarRegistrationNo as Primary Key) (5)<br />

CarRegistrationNo DriverLicenceNo HireDate ReturnDate CarMake DriverName<br />

TSG9720 EJ007823KS8 12/10/06 14/10/06 Mercedes Elton John<br />

MGH9812 AW002364IG1 08/08/06 01/11/06 Ferrari Andrew Webber<br />

ASB1001 BB009362UW6 22/01/06 12/12/06 BMW Boris Becker<br />

SDK9812 IT001234AB5 15/06/06 31/12/06 Volvo Ian Thorpe


CS5035 (Introduction to Database Systems) - 2 - 2006-<strong>2007</strong><br />

The following questions (2, 3 & 4) refer to the relational tables listed below. These tables describe data related to a Project<br />

Management System.<br />

Assignments<br />

TaskID StaffID StartDate EndDate<br />

AM00090 cs01jf 15/09/2006 10/11/2006<br />

AM00090 cs01rw 15/09/2006 15/10/2006<br />

AM00090 cs03mp 16/10/2006 10/11/2006<br />

CA00067 cs00aj 01/11/2006 05/11/2006<br />

FT00017 cs00aj 01/08/2006 30/09/2006<br />

FT00017 cs00gp 01/08/2006 01/09/2006<br />

FT00017 cs03mp 01/09/2006 30/09/2006<br />

Projects<br />

ProjID ProjName ProjStartDate ProjEndDate ProjValue ProjBalance<br />

RGA0896 FastTrack 12/05/2003 11/05/2008 £234,000.00 £87,000.00<br />

RGB2091 CASE 01/01/2001 31/12/2010 £609,875.00 £28,900.00<br />

RGD0941 DiveTalk 01/04/2005 31/03/<strong>2007</strong> £79,000.00 £27,000.00<br />

RGI6123 AuralMaps 01/09/2006 31/08/2009 £328,567.00 £298,123.00<br />

Staff<br />

StaffID fName lName YearsOfJavaExperience YearsOfSwingExperience YearsOfMySqlExperience<br />

cs00aj Alice Johnson 8 8 5<br />

cs00gp Gerald Pratt 12 12 5<br />

cs01jf James Farmer 6 4 7<br />

cs01rw Ralph Washington 3 3 1<br />

cs03mp Mike Phillips 5 3 3<br />

Tasks<br />

TaskID TaskName Description Deliverable EstimatedTime ProjID<br />

AM00090 Clusterer<br />

Implementation<br />

CA00067 Client Interview<br />

Implement region growing<br />

clusterer<br />

Interview client from HAL,<br />

Glasgow<br />

clusterer java<br />

class<br />

Interview<br />

Transcript<br />

60 RGI6123<br />

2 RGB2091<br />

DT00145 Data backup Take backup of p3/data folder backup tape 1 RGD0941<br />

FT00011 Corpus backup Take backup of p9/corpus folder backup tape 1 RGA0896<br />

FT00017 Filter Implementation Implement segmentation filter filter java class 40 RGA0896


CS5035 (Introduction to Database Systems) 2006-<strong>2007</strong><br />

2. (a) In SQL, give one example of each of the following types of statements (use the Staff table if you need to refer to a<br />

table in your answer)<br />

(i) a Data Manipulation Language (DML) statement (1)<br />

(ii) a Data Definition Language (DDL) statement (1)<br />

(iii) a Data Control Language (DCL) statement (1)<br />

(b) Write an SQL statement to add a new task to the database with the following details (use only the data specified below;<br />

do not assume any new data):<br />

TaskID: CA00033<br />

TaskName: Code backup<br />

Description: Take backup of p1/src folder<br />

Deliverable: backup tape<br />

ProjID: RGB2091 (2)<br />

(c) Using only the Tasks table, write an SQL query to show the ‘sum’ of the estimated times which are larger than 10 hours<br />

for all the tasks belonging to each of the projects. (5)<br />

(d) Write an SQL query to show all the task names and their corresponding project names and sort the list in the ascending<br />

order of project name and task name. (5)<br />

(e) Write an SQL query to show all the task names and their corresponding project names assigned to Mike Phillips.<br />

(5)<br />

(f) Write an SQL query to show the first name and last names of those staff that have less than 2 tasks assigned. (5)


CS5035 (Introduction to Database Systems) - 4 - 2006-<strong>2007</strong><br />

3. (a) In relational database query processing, briefly explain the role played by relational algebra expressions and explain<br />

how relational algebra trees (RATs) are used in query optimisation. (5)<br />

(b) In a multi-user DBMS, user interactions with the DBMS server should fulfil four fundamental requirements denoted by<br />

“ACID”. What does “ACID” stand for, and briefly describe the four requirements it represents? (4)<br />

(c) What are views? Give one example each of a horizontal and a vertical view. (3)<br />

(d) Explain how views and privileges help you to achieve fine grain access control over data in database tables. (4)<br />

(e) Consider the following SQL query which refers to the Staff and Assignments tables given above:<br />

SELECT *<br />

FROM Staff S, Assignments A<br />

WHERE S.StaffID = A.StaffID<br />

AND S.lName='Washington'<br />

AND S.fName='Ralph';<br />

Using the relational algebra notation, σ P for selection with predicate P, × for a Cartesian product, for a natural join,<br />

and for conjunction, write down three different but logically equivalent ways of expressing the above query in<br />

relational algebra. In your answers, use the given table aliases for brevity, use brackets as necessary to avoid<br />

ambiguities, and label your answers A, B and C. (6)<br />

(f) In the database given above, suppose the Staff and Assignments tables have very many rows but have no indexes.<br />

Arrange your solutions (A, B, C) from (e) in order of efficiency and justify your answer. (3)


CS5035 (Introduction to Database Systems) - 5 - 2006-<strong>2007</strong><br />

4. (a) MySQL mainly supports two table types called MYISAM and INNODB. Describe three ways in which these two table<br />

types differ. (3)<br />

(b) In a multi-user DBMS, sometimes deadlocks can occur between transactions. Describe in general terms when a<br />

deadlock might occur and explain how deadlocks are usually detected and resolved in order to leave the database in a<br />

consistent state. (5)<br />

(c) With the help of a sketch, explain the various stages in which a request for a php file that contains MySQL queries is<br />

processed by a web server. (3)<br />

(d) Explain why symmetric key encryption is not a suitable method for encrypting data to be sent over the internet, and<br />

briefly describe how the public key / private key technique largely addresses this problem. (5)<br />

(e) What are the different types of spatial queries that spatial databases support? Describe one index scheme you will use to<br />

enhance the performance of spatial queries. (4)<br />

(f) List three different ways of file organization or access methods used in DBMSs. Discuss the performance of search,<br />

insert and delete operations on each of the file organizations. (5)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!