You are on page 1of 9

Coursework cover sheet – be sure to keep a copy of all work submitted

Submit via the coursework post box in the Armstrong Siddeley Building ASG15
Section A - To be completed by the student – PLEASE PRINT CLEARLY
Family Name(s) ModuleNo.
     
Forename(s)
220CT
     
ID Number(s) (from your student card)
     
Time taken (hrs) (per student for group coursework)
      Faculty Date Stamp
(or signature and date)
Lecturer Lab group / Tutorial group / Tutor (if applicable)
P. Woodfield
Module Code and Title Due date:
220ct Database System Concepts 14th March 2011
Assignment No. / Title Extensions & late submissions allowed:
PhoenixSoft Yes

Estimated Time (hrs) Assignment type: % of Module Mark Hand out date:
8 Individual/Group(maximum 3) 25 24th January 2011

Penalties: Marks will be reduced by 10% of the original mark for every week late. No work will be accepted that is more than two weeks late. If
you are unable to submit coursework on time due to extenuating circumstances you may be eligible for an extension. Full details on Faculty
coursework policy and procedures are available at http://www.coventry.ac.uk/swift/Open/Student/Regulations/06stcwproc.doc
Declaration: I/we the undersigned confirm that I/we have read and agree to abide by the University regulations on plagiarism and
cheating and Faculty coursework policies and procedures. I/we confirm that this piece of work is my/our own. I/we consent to
appropriate storage of our work for checking to ensure that there is no plagiarism/ academic cheating.

Signature(s): -------------------------------------- -------------------------------------- --------------------------------------


--------------------------------------
Section B - To be completed by the assessor
1. understand and apply SQL queries, aggregate functions, joins and subqueries.
2. investigate and discuss issues related to multi-user access
Marks breakdown Max Awarded
1. Table creation 20

2. SQL Queries 50

3. Fragmentation Report 25

2. Overall report and presentation 5

Assessor’s signature / initials: Date: Total Total

100
Extension Agreed until: Penalty Due: Penalty Final Mark

(Yes / No)
Programme Leader Signature:
Signed internal moderator: This work may have been moderated. You may find additional comments in the
work.

This section may be used for feedback or other information


PhoenixSoft
PhoenixSoft is a software house specialising in NHS contracts. The company
prides itself by selecting only those staff with topnotch skillsets – it is thus able to
charge premium rates to customers for these skillsets. Staff are seconded from various
departments to work on projects for a certain length of time.
Some staff employed is contract staff not belonging to any particular department.

Staff information about staff:


Staff number, staff lastname, staff department, and staff skillset code.

Skill Set information about skills:


Skillset code, skillset description, and staff rate of this skillset in
pounds per hour.

Project information about projects:


Project number, project start date, project end date, project budget,
and project manager.

Work Load information about work loads;


staff number, project number, date worked on, and Workload hours.

The schemas of the generated tables, with the primary keys underlined, are as follows:

Staff(staffNo, staffName, staffDepartment, skillsetCode)


Skillset(skillsetCode, skillsetDescription, skillsetStaffRate)
Project(projectNo, startDate, endDate, budget, projectManager)
Workload(staffNo , projectNo, dateWorkedOn, WorkloadHours)

Task
1. Create tables and insert all the data provided in Appendix A

a) Use SQL commands to create all the tables.

CREATE TABLE Staff


(
staffNo CHAR(5) NOT NULL,
staffName CHAR(20) NOT NULL,
staffDepartment CHAR(20),
skillsetCode CHAR(5) NOT NULL,
PRIMARY KEY (staffNo));

CREATE TABLE Skillset


(
skillsetCode CHAR(5) NOT NULL,
skillsetDescription CHAR(25) NOT NULL,
skillsetStaffRate CHAR(3) NOT NULL,
PRIMARY KEY (skillsetCode));

CREATE TABLE Project


(
projectNo CHAR(1),
startDate DATE NOT NULL,
endDate DATE NOT NULL,
budget CHAR(8) NOT NULL,
projectManager CHAR(4) NOT NULL,
PRIMARY KEY (projectNo));

CREATE TABLE Workload


(
staffNo CHAR(5),
projectNo CHAR(1),
dateWorkedOn DATE,
WorkloadHours INT(1),
PRIMARY KEY (staffNo, projectNo, dateWorkedOn));
(12 marks)
b) Use SQL commands to insert data into the tables.

INSERT INTO Staff VALUES (12123, Green, Specials, A0000);


INSERT INTO Staff VALUES (26254, Smith, Finance, B0000);
INSERT INTO Staff VALUES (8765, Johnson, Sales, B0000);
INSERT INTO Staff VALUES (97865, Taylor, Health, D0001);
INSERT INTO Staff VALUES (923, Kurusawa, None, E0001);
INSERT INTO Staff VALUES (9567, Bashir, Leisure, F0001);
INSERT INTO Staff VALUES (8453, Lang, Leisure, G0001);
INSERT INTO Staff VALUES (8762, Patel, Leisure, H0001);
INSERT INTO Staff VALUES (23982, Chao, Network, M0001);
INSERT INTO Staff VALUES (3000, Adam, Projects, P0001);
INSERT INTO Staff VALUES (3001, Brent, Projects, P0001);
INSERT INTO Staff VALUES (3002, Sadler, Projects, P0001);
INSERT INTO Staff VALUES (3003, Wells, Projects, P0001);
INSERT INTO Staff VALUES (3004, Riaz, Projects, P0001);

INSERT INTO Skillset VALUES(A0000, Design, 50);


INSERT INTO Skillset VALUES(B0000, Analysis, 55);
INSERT INTO Skillset VALUES(D0001, C++, 60);
INSERT INTO Skillset VALUES(E0001, Visual Basic, 65);
INSERT INTO Skillset VALUES(F0001, Java, 65);
INSERT INTO Skillset VALUES(G0001, Smalltalk, 70);
INSERT INTO Skillset VALUES(H0001, Assembler, 75);
INSERT INTO Skillset VALUES(M0001, Testing, 90);
INSERT INTO Skillset VALUES(P0001, Management, 100);

INSERT INTO Project VALUES(1, 01/01/10, 15/06/10, 12000, 3000);


INSERT INTO Project VALUES(2, 16/06/10, 31/12/10, 15500, 3001);
INSERT INTO Project VALUES(3, 01/01/11, 31/03/11, 34000, 3002);
INSERT INTO Project VALUES(4, 01/02/10, 12/04/10, 12500, 3003);
INSERT INTO Project VALUES(5, 12/09/10, 30/09/10, 500, 3004);
INSERT INTO Project VALUES(6, 11/11/10, 01/12/10, 750, 3003);
INSERT INTO Project VALUES(7, 12/01/11, 13/06/11, 16000, 3002);
INSERT INTO Project VALUES(8, 01/08/11, 31/08/11, 1500, 3001);
INSERT INTO Project VALUES(9, 05/04/10, 30/04/11, 8000, 3000);

INSERT INTO Workload VALUES(12123, 1, 01/01/10, 8);


INSERT INTO Workload VALUES(26254, 1, 05/01/10, 8);
INSERT INTO Workload VALUES(8765, 1, 06/10/10, 4);
INSERT INTO Workload VALUES(12123, 2, 17/06/10, 7);
INSERT INTO Workload VALUES(8765, 2, 18/06/10, 6);
INSERT INTO Workload VALUES(97865, 3, 01/02/11, 8);
INSERT INTO Workload VALUES(923, 4, 16/02/10, 8);
INSERT INTO Workload VALUES(9567, 4, 21/02/10, 4);
INSERT INTO Workload VALUES(8453, 4, 23/03/10, 6);
INSERT INTO Workload VALUES(8762, 4, 12/03/10, 1);
INSERT INTO Workload VALUES(12123, 5, 12/09/10, 8);
INSERT INTO Workload VALUES(923, 5, 13/09/10, 3);
INSERT INTO Workload VALUES(8765, 6, 15/11/10, 4);
INSERT INTO Workload VALUES(12123, 6, 30/11/10, 5);
INSERT INTO Workload VALUES(97865, 6, 16/11/10, 8);
INSERT INTO Workload VALUES(23982, 6, 29/11/10, 8);
INSERT INTO Workload VALUES(8765, 7, 12/01/11, 8);
INSERT INTO Workload VALUES(9000, 7, 13/01/11, 8);
INSERT INTO Workload VALUES(8765, 7, 14/01/11, 8);
INSERT INTO Workload VALUES(12123, 7, 15/01/11, 8);
INSERT INTO Workload VALUES(23982, 7, 01/06/11, 8);
INSERT INTO Workload VALUES(8765, 8, 01/08/11, 5);
INSERT INTO Workload VALUES(8765, 9, 05/04/10, 8);
INSERT INTO Workload VALUES(12123, 9, 12/04/11, 8);
INSERT INTO Workload VALUES(23982, 9, 19/04/11, 8);

(8 marks)

(Total: 20 marks)

2. Use SQL commands for the following queries. Produce the queries as well as the
query results.

a) List all skillsets that charge more than 60 pounds per hour, in alphabetical
order of description.

SELECT DISTINCT skillsetStaffRate


FROM Skillset

b) List all staff with the skillset description 'Analysis' who work in the 'Specials'
department.
(7 marks)

c) How many staff have the skillset 'Java'?.


(7 marks)

d) For all the projects that were active on '1 March 2010' (i.e. where the start
date is before this date and the end date is after this date), list the staff names,
departments, project numbers, date and number of hours, ordered by project
number and within that by staff name and within that name by date, for all
staff who worked on active projects.
(9 marks)

e) List the project numbers and total numbers of hours worked on, for projects
that were worked on for more than 16 hours?
(9 marks)

f) List the names and departments where the staff rate is greater than the
average staff rate (the average staff rate is the sum of all staff rates for all
different skillsets divided by the number of skillsets).
(14 marks)

(Total: 50 marks)
3. Write in your own words a brief report (about 700 words) to the users to
address their concerns about horizontal/vertical/mixed fragmentation of
relations. The report should cover issues such as performance, integrity,
privacy and security.
(25 marks)

4. Overall presentation of the submission.


(5 marks)
Assessment criteria

In order to achieve a pass in this assignment you must be able to


• create suitable Oracle tables using SQL.
• populate the database correctly from sample data.
• run simple SQL commands.
• submit listings of your SQL queries and give a brief description of their purpose and
behaviour so that it is possible to understand what you are trying to achieve.
• investigate issues related to fragmentation.
• produce a suitable report for your submission.

In order to produce a first class assignment you must be able


• create and populate a database correctly.
• present a rationale for the SQL statements.
• construct SQL commands to join tables, include sub-queries and create views as
required.
• submit listings of your SQL queries and give a brief description of their purpose and
behaviour so that it is possible to understand what you are trying to achieve.
• present clearly and discuss critically issues related to fragmentation.
• produce a good report for your submission.

SQL> ED

Paste the content, save

SQL>/
Appendix A
Project Start End Budget Manager Skill Description Staff Staff Staff Staff Date Hrs

No Date Date Set Rate No Name Dept worked

on
1 01/01/10 15/06/10 £12,000 3000 A0000 Design £50 12123 Green Specials 01/01/10 8
1 01/01/10 15/06/10 £12,000 3000 B0000 Analysis £55 26254 Smith Finance 05/01/10 8
1 01/01/10 15/06/10 £12,000 3000 B0000 Analysis £55 8765 Johnson Sales 06/10/10 4
2 16/06/10 31/12/10 £15,500 3001 A0000 Design £50 12123 Green Specials 17/06/10 7
2 16/06/10 31/12/10 £15,500 3001 B0000 Analysis £55 8765 Johnson Sales 18/06/10 6
3 01/01/11 31/03/11 £34,000 3002 D0001 C++ £60 97865 Taylor Health 01/02/11 8
4 01/02/10 12/04/10 £12,500 3003 E0001 Visual Basic £65 923 Kurusawa None 16/02/10 8
4 01/02/10 12/04/10 £12,500 3003 F0001 Java £65 9567 Bashir Leisure 21/02/10 4
4 01/02/10 12/04/10 £12,500 3003 G0001 Smalltalk £70 8453 Lang Leisure 23/03/10 6
4 01/02/10 12/04/10 £12,500 3003 H0001 Assembler £75 8762 Patel Leisure 12/03/10 1
5 12/09/10 30/09/10 £500 3004 A0000 Design £50 12123 Green Specials 12/09/10 8
5 12/09/10 30/09/10 £500 3004 E0001 Visual Basic £65 923 Kurusawa None 13/09/10 3
6 11/11/10 01/12/10 £750 3003 B0000 Analysis £55 8765 Johnson Sales 15/11/10 4
6 11/11/10 01/12/10 £750 3003 A0000 Design £50 12123 Green Specials 30/11/10 5
6 11/11/10 01/12/10 £750 3003 D0001 C++ £60 97865 Taylor Health 16/11/10 8
6 11/11/10 01/12/10 £750 3003 M0001 Testing £90 23982 Chao Network 29/11/10 8
7 12/01/11 13/06/11 £16,000 3002 B0000 Analysis £55 8765 Johnson Sales 12/01/11 8
7 12/01/11 13/06/11 £16,000 3002 B0000 Analysis £55 9000 Johnson Media 13/01/11 8
7 12/01/11 13/06/11 £16,000 3002 B0000 Analysis £55 8765 Johnson Sales 14/01/11 8
7 12/01/11 13/06/11 £16,000 3002 A0000 Design £50 12123 Green Specials 15/01/11 8
7 12/01/11 13/06/11 £16,000 3002 M0001 Testing £90 23982 Chao Network 01/06/11 8
8 01/08/11 31/08/11 £1500 3001 B0000 Analysis £55 8765 Johnson Sales 01/08/11 5
9 05/04/10 30/04/10 £8,000 3000 B0000 Analysis £55 8765 Johnson Sales 05/04/10 8
9 05/04/10 30/04/10 £8,000 3000 A0000 Design £50 12123 Green Specials 12/04/10 8
9 05/04/10 30/04/10 £8,000 3000 M0001 Testing £90 23982 Chao Network 19/04/10 8
N/A N/A N/A N/A N/A P0001 Management £100 3000 Adam Projects N/A N/A
N/A N/A N/A N/A N/A P0001 Management £100 3001 Brent Projects N/A N/A
N/A N/A N/A N/A N/A P0001 Management £100 3002 Sadler Projects N/A N/A
N/A N/A N/A N/A N/A P0001 Management £100 3003 Wells Projects N/A N/A
N/A N/A N/A N/A N/A P0001 Management £100 3004 Riaz Projects N/A N/A
BLANK PAGE

You might also like