Вы находитесь на странице: 1из 14

The Independent Institute of Education 2017

MODULE NAME: MODULE CODE:


ADVANCED DATABASES ADDB7311

ASSESSMENT TYPE: ASSIGNMENT 1 (PAPER ONLY)

TOTAL MARK ALLOCATION: 100 MARKS

TOTAL HOURS: 10 HOURS

By submitting this assignment you acknowledge that you have read and understood all the rules as
per the terms in the registration contract, in particular the assignment and assessment rules in The
IIE Assessment Strategy and Policy (IIE009), the intellectual integrity and plagiarism rules in the
Intellectual Integrity Policy (IIE023), as well as any rules and regulations published in the student
portal.
INSTRUCTIONS:

1. No material may be copied from original sources, even if referenced correctly, unless it is a
direct quote indicated with quotation marks. No more than 10% of the assignment may
consist of direct quotes.
2. Any assignment with a similarity index of more than 25% will be scrutinized for
plagiarism.
3. Make a copy of your assignment before handing it in.
4. Assignments must be typed unless otherwise specified.
5. All work must be adequately and correctly referenced.
6. Begin each section on a new page.
7. Follow all instructions on the assignment cover sheet.
1. This is an individual assignment.

© The Independent Institute of Education (Pty) Ltd 2017


Page 1 of 14
The Independent Institute of Education 2017

Referencing Rubric

Providing evidence based on valid and referenced academic sources is a fundamental educational
principle and the cornerstone of high quality academic work. Hence, The IIE considers it essential to
develop the referencing skills of our students in our commitment to achieve high academic
standards.

Poor quality formatting in your referencing will result in a penalty of a maximum of five (5) marks
against the percentage mark awarded, according to the following guidelines. Please note, however,
that evidence of plagiarism in the form of copied or uncited work (not referenced), absent
reference lists, or exceptionally poor referencing, may result in action being taken in accordance
with The IIE’s Intellectual Integrity Policy (0023).

Required Subtract 1 Subtract 2 Subtract 3 Subtract 4 Subtract 5


 Consistent in-  Consistent in-  Consistent in-  Consistent  In-text  Poor and
text text referencing text in-text referencing inconsistent
referencing style referencing referencing used but referencing
style  Quotation style style inconsistent style used
 Quotation marks, page  Quotation  Quotation  Paraphrased  At least 50%
marks, page numbers, years, marks, page marks used material cited of the
numbers, etc. applied numbers, for direct but not sources are
years, etc. correctly years, etc. not quotes but referenced correctly
applied  Fewer than five always page accurately or reflected
correctly minor mistakes applied numbers consistently and included
 Only one or made correctly missing in text in reference
two minor  More than 90%  Not all  At least 70%  Quotation list
mistakes in of the sources paraphrased of the marks and/or  Quotation
style made are correctly content sources are page numbers marks
 All sources reflected and referenced correctly for direct and/or page
are included in a  At least 80% reflected quotes numbers for
accurately reference list of the sources and missing direct quotes
reflected and are correctly included in  At least 60% missing
included in a reflected and a reference of the sources  May be
reference list included in a list are correctly referred for
reference list reflected and action in
included in accordance
reference list with IIE 0023
Intellectual
Integrity
Policy

© The Independent Institute of Education (Pty) Ltd 2017


Page 2 of 14
The Independent Institute of Education 2017

CASE STUDY
Study the following case study and answer the questions that are based thereon:

HYBRID MEDICAL DESIGNS is a small privately owned manufacturing company. HYBRID


MEDICAL DESIGNS has grown from strength to strength due to excellent service and a wide
variety of bespoke products that has revolutionised the medical industry. The company at
present is under pressure to maintain their data needs due to an increase in customers,
products, staff, drivers, vehicles, billing and deliveries.

You have been contracted to design a database for HYBRID MEDICAL DESIGNS. The company
opened their doors to the public 12 months ago and requires a database to manage all aspects of
their business. At present there is only one outlet, but a new franchised outlet will be opening in
the next three months.

The following has been provided:

STATE ALL ASSUMPTIONS you need to develop the queries. Copy and paste the SQL code and the
screenshot of the results into a Word document. Save this file as “ADDB7311 Assignment 1 –
Student Number”. Print this out and hand in with a coversheet.

The following has been provided:

CUSTOMER TABLE
CUSTOMER_ID FIRST_NAME SURNAME ADDRESS PHONE_NUM EMAIL
cust101 Jeffery Jones 10 Main 011 597 4585 jj@isat.com
Road
cust102 Andre Williams 15 Water 021 598 5685 aw@isat.com
Road
cust103 Clark Jenson 28 031 589 5412 cjen@msky.com
Mountain
Way
cust104 Alex Smith 12 Circle 051 585 6965 asm@cnet.co.za
Lane
cust105 Wayne Henry 25 Cape 041 758 9857 wayneh@isat.com
Road

© The Independent Institute of Education (Pty) Ltd 2017


Page 3 of 14
The Independent Institute of Education 2017

STAFF_ID FIRST_NAME SURNAME STAFF_TYPE CONTACT EMAIL


st_551 Bob Orlando Type 1 082 123 bob@hmd.co.za
4567
st_552 Shane Watson Type 3 076 897 swat@hmd.co.za
4568
st_553 Kelly Samson Type 2 072 585 sam@hmd.co.za
5458
st_554 Arlene Leem Type 1 081 254 al@hmd.co.za
2535
st_555 Jennifer Paulsen Type 1 061 565 jp@hmd.co.za
8925
STAFF TABLE

DRIVER TABLE

DRIVER_ID FIRST_NAME SURNAME DRIVER_LEVEL PHONE_NUM


11111 Henry de Klerk 5 061 555 8787
11112 Wesley James 4 084 556 9857
11113 Reece Bitterhout 2 076 768 4587
11114 Jonathan Mdidimba 3 083 333 3525
11115 John Maqojana 1 079 565 8789

VEHICLE TABLE

VIN VEHICLE_TYPE MILEAGE MANUFACTURER


TF1BB2VE533093891 Panel Van 181 325 MAN
TF1BB2VE533093822 Standard Van 79 885 FORD
TF1BB2VE533093893 Medium Van 175 898 ISUZU
TF1BB2VE533093894 Panel Van 12 500 MAN
TF1BB2VE533093895 Standard Van 8 012 FORD

PRODUCTS TABLE

© The Independent Institute of Education (Pty) Ltd 2017


Page 4 of 14
The Independent Institute of Education 2017

PROD_ID PROD_NAME PROD_PRICE WARRANTY


Prod_111 Air Duct Assembly R15 898 3 Years
Prod_222 Humidity Sensor R9 858 2 Years
Prod_333 CNC Imager R35 012 3 Years
Prod_444 Infrared Imager R89 002 2 Years
Prod_555 Laboratory Mixer R8 521 5 Years

BILLING TABLE
BILL_ID CUSTOMER_ID STAFF_ID BILL_DATE QUANTITY
hmd5515 cust105 st_551 10 March 2017 2
hmd5598 cust101 st_553 10 March 2017 1
hmd6585 cust102 st_553 11 March 2017 5
hmd7858 cust103 st_554 11 March 2017 3
hmd9858 cust105 st_555 12 March 2017 1

DELIVERY TABLE
DELIVERY_I DELIVERY_DAT VIN PROD_ID DRIVER_I CUSTOMER_I
D E D D
del_2211 15 March 2017 TF1BB2VE53309389 Prod_11 11111 cust101
5 1
del_2212 15 March 2017 TF1BB2VE53309389 Prod_33 11115 cust103
3 3
del_2213 17 March 2017 TF1BB2VE53309389 Prod_22 11114 cust101
1 2
del_2214 18 March 2017 TF1BB2VE53309389 Prod_55 11112 cust103
3 5
del_2215 19 March 2017 TF1BB2VE53309389 Prod_11 11112 cust105
1 1
del_2216 19 March 2017 TF1BB2VE53309389 Prod_11 11115 cust105
3 1
del_2217 20 March 2017 TF1BB2VE53309389 Prod_22 11111 cust101
1 2
del_2218 25 March 2017 TF1BB2VE53309389 Prod_22 11112 cust103
5 2

© The Independent Institute of Education (Pty) Ltd 2017


Page 5 of 14
The Independent Institute of Education 2017

del_2219 25 March 2017 TF1BB2VE53309389 Prod_33 11115 cust101


3 3

© The Independent Institute of Education (Pty) Ltd 2017


Page 6 of 14
The Independent Institute of Education 2017

HYBRID MEDICAL DESIGNS

STAFF PRODUCTS
DRIVER
Staff_ID (PK) Prod_ID (PK)
Driver_ID (PK)
1 First_Name Prod_Name
First_Name
perform Surname Prod_Price
Surname
s
Staff_Type Warranty
Driver_Level
Contact 1
Phone_Num
M Email
has

BILLING
Bill_ID (PK) M 1

Customer_ID (FK)
DELIVERY
Staff_ID (FK) M
Delivery_ID (PK) has
Bill_Date
CUSTOMER Delivery_Date
Quantity
Customer_ID (PK) VIN (FK)
M has
First_Name Prod_ID (FK)
M
1 VEHICLE
1 Surname Driver_ID (FK)
receives VIN (PK)
Address Customer_ID (FK)
Vehicle_Type
Phone_Num
M
Mileage
Email 1
assign Manufacturer

© The Independent Institute of Education (Pty) Ltd 2017


Page 7 of 14
The Independent Institute of Education 2017

Question 1 (Marks: 10)


Create table statements for all the tables in the ERD above using a new database schema.

Requirement Mark Examiner


New database schema created 10
and all tables created
correctly.

Question 2 (Marks: 10)

Using SQL code create and populate each of the tables with the provided information using SQL
Developer or SQL*PLUS.

Requirement Mark Examiner


Insert statements per table 10
inserted correctly.

Question 3 (Marks: 6)
Create a SQL query to display the combined customer name, staff id, delivery id and the vehicle
type that made the deliveries on the 25 March 2017.

Sample Results:
CUSTOMER STAFF_ID DRIVER_ID VEHICLE_TYPE
Jeffery, Jones st_553 del_2219 Medium Van
Clark, Jenson st_554 del_2218 Standard Van

Marking Guideline:
Requirement Mark Examiner
Correct select statement 2
Correct tables used 2
Correct where statements and 2
order by
Total 6

© The Independent Institute of Education (Pty) Ltd 2017


Page 8 of 14
The Independent Institute of Education 2017

Question 4 (Marks: 6)

Create a SQL query to display the staff id, driver id, product name and the mileage of the vehicle
that made the delivery. In your query only display the results for a vehicle that has a mileage of
less than 100 000km.

Sample Results:
STAFF_ID DRIVER_ID PRODUCT_NAME VEHICLE _MILEAGE
st_553 11111 Air Duct Assembly 8012
st_554 11112 Humidity Sensor 8012

Marking Guideline:
Requirement Mark Examiner
Correct select statement 2
Correct tables used 2
Correct where statements. 2
Total 6

Question 5 (Marks: 8)
Create a SQL query to display the customer first name, surname, product to be delivered and the
bill amount due. In your query only display the bill amount due by a customer that is greater than
R100 000.

Sample Results:
FIRST_NAME SURNAME PRODUCT BILL_AMOUNT
Clark Jenson CNC Imager R 105 036

Marking Guideline:
Requirement Mark Examiner
Correct select statement used 2
Correct table used 2
Correct where clause used 2
Output displayed 2
Total 8

© The Independent Institute of Education (Pty) Ltd 2017


Page 9 of 14
The Independent Institute of Education 2017

Question 6 (Marks: 12)


Management of Hybrid Medical Designs is deciding on applying a price increase to all their
products. Before the price increase is done produce a PL/ SQL query to display the product name
with a 15% and 25% increase of the products for managerial decision making.

Sample Results:
anonymous block completed
PRODUCT: AIR DUCT ASSEMBLY
15% INCREASE: R18 282.7
25% INCREASE: R19 872.5
----------------------------------------------
PRODUCT: HUMIDITY SENSOR
15% INCREASE: R11 336.7
25% INCREASE: R12 322.5
----------------------------------------------
PRODUCT: CNC IMAGER
15% INCREASE: R40 263.8
25% INCREASE: R43 765
----------------------------------------------
PRODUCT: INFRARED IMAGER
15% INCREASE: R102 352.3
25% INCREASE: R111 252.5
----------------------------------------------
PRODUCT: LABORATORY MIXER
15% INCREASE: R9 799.15
25% INCREASE: R10 651.25
----------------------------------------------

Marking Guideline:
Requirement Mark Examiner
Declare statement 2
Variables declared 2
Begin statement 1

© The Independent Institute of Education (Pty) Ltd 2017


Page 10 of 14
The Independent Institute of Education 2017

Requirement Mark Examiner


Correct select statement used 1
Correct table used 1
Correct where clause used 2
Output displayed 2
End statement 1
Total 12

Question 7 (Marks: 12)


Management of Hybrid Medical Designs require a query to determine the top selling products.
Create a PL/SQL query to display the product names that have been delivered to a customer three
(3) or more times.

Sample Results:
anonymous block completed
PRODUCT NAME: AIR DUCT ASSEMBLY
DELIVERY COUNT: 3
------------------------------------------------------
PRODUCT NAME: HUMIDITY SENSOR
DELIVERY COUNT: 3
------------------------------------------------------

Marking Guideline:
Requirement Mark Examiner
Declare statement 1
Variables declared 2
Begin statement 1
Correct select statement used 2
Correct table used 1
Correct where clause used 2
Output displayed 2
End statement 1
Total 12

© The Independent Institute of Education (Pty) Ltd 2017


Page 11 of 14
The Independent Institute of Education 2017

Question 8 (Marks: 10)

Create a view called Delivery Days to display the combined customer name, the bill date, delivery
date and calculate the amount of days that elapsed from the bill date to the delivery date. In your
query only display the deliveries that took 10 or more days to reach the customer and provide the
code to execute the view.

Sample Results:
CUSTOMER BILL_DATE DELIVERY_DATE DAYS_TO_DELIVER
Clark, Jenson 11/MAR/17 25/MAR/17 14
Jeffery, Jones 10/MAR/17 25/MAR/17 15
Jeffery, Jones 10/MAR/17 20/MAR/17 10

Marking Guideline:
Requirement Mark Examiner
View created 1
Correct select statement used 2
Correct table used 2
Correct where clause used 2
Output displayed 2
Code to execute the view 1
Total 10

Question 9 (Marks: 14)

Management of Hybrid Medical Designs requires a list of poor performing products for emergency
review purposes. Create a PL/SQL query to display the products that have been sold and delivered
only once or not at all. In your query, display Emergency Review if the purchase or delivery count
is zero.

Sample Results:
anonymous block completed
PRODUCT NAME: LABORATORY MIXER
PURCHASE AND DELIVERY COUNT: 1
--------------------------------------------------------------

© The Independent Institute of Education (Pty) Ltd 2017


Page 12 of 14
The Independent Institute of Education 2017

PRODUCT NAME: INFRARED IMAGER


PURCHASE AND DELIVERY COUNT: 0
EMERGENCY REVIEW NEEDED!!!
--------------------------------------------------------------

Marking Guideline:
Requirement Mark Examiner
Declare statement 1
Variables declared 2
Begin statement 1
Correct select statement used 2
Correct table used 2
Correct use of decision statement 3
Output displayed 2
End statement 1
Total 14

Question 10 (Marks: 12)


Hybrid Medical Designs considers trading in their delivery vehicles once it has travelled over
150 000km.
Create a PL/SQL query to display the VIN, vehicle type, manufacturer, mileage and whether the
vehicle should be traded in or not.

Sample Results:
anonymous block completed
VIN: TF1BB2VE533093891
TYPE: Panel Van
MANUFACTURER: MAN
MILEAGE: 181325
TRADE IN: YES
--------------------------------------------------------
VIN: TF1BB2VE533093822
TYPE: Standard Van
MANUFACTURER: FORD
MILEAGE: 79885

© The Independent Institute of Education (Pty) Ltd 2017


Page 13 of 14
The Independent Institute of Education 2017

TRADE IN: NO
--------------------------------------------------------
VIN: TF1BB2VE533093893
TYPE: Medium Van
MANUFACTURER: ISUZU
MILEAGE: 175898
TRADE IN: YES
--------------------------------------------------------
VIN: TF1BB2VE533093894
TYPE: Panel Van
MANUFACTURER: MAN
MILEAGE: 12500
TRADE IN: NO
--------------------------------------------------------
VIN: TF1BB2VE533093895
TYPE: Standard Van
MANUFACTURER: FORD
MILEAGE: 8012
TRADE IN: NO
--------------------------------------------------------
Marking Guideline:
Requirement Mark Examiner
Declare statement 1
Variables declared 1
Begin statement 1
Correct select statement used 2
Correct table used 2
Correct use of decision 3
statement
Output displayed 1
End statement 1

Total 12

[TOTAL MARKS: 100]

© The Independent Institute of Education (Pty) Ltd 2017


Page 14 of 14

Вам также может понравиться