Академический Документы
Профессиональный Документы
Культура Документы
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.
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).
CASE STUDY
Study the following case study and answer the questions that are based thereon:
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.
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.
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
DRIVER TABLE
VEHICLE TABLE
PRODUCTS TABLE
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
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
Using SQL code create and populate each of the tables with the provided information using SQL
Developer or SQL*PLUS.
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
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
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
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
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
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
--------------------------------------------------------------
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
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
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