Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please help using SQL plus or SQL Developer EMPLOYEE table [ [ EmplD , First _ Name,Surname,Contact _ Num,Email,Address ] , [ 1 0

please help using SQL plus or SQL Developer
EMPLOYEE
\table[[EmplD,First_Name,Surname,Contact_Num,Email,Address],[101,Cameron,Willis,0843569851,cw@isat.co.za,11 Main rd],[102,Jessie,Wait,0763698521,iwait@imail.com,27 Water way],[103,Andre,Gumede,0786598521,agum@mcare.co.za,15 Cape st],[104,Marie,Du Preez,0796369857,mduppie@isat.co.za,20 Long rd],[105,Eric,Jones,0826598741,ejones@nrom.co.za,3 Temperance],[,,,,,st]]
CUSTOMER
\table[[CustomerID,First_Name,Surname,Contact_Num,Address,Bank],[A1001,Asavela,Bitterhout,0769856895,15 Table rd,ABSA],[A1002,Henry,James,0742598657,28 Sea Side rd,NEDBANK],[A1003,Joe,Bloggs,0863256982,19 Upper End,FNB],[A1004,Clark,Smith,0785659857,27 South end,ABSA],[A1005.,Jabu,Xolani,0712369571,12 Main rd,FNB]]
SUPPLIER
\table[[SupplierID,SupplierName,Contact_Num,Rating],[751,Adventure Gear,0113256958,7],[752,Ultra Outdoor,0212569857,5],[753,Xtreme Gear,0310524589,9],[754,Sky and Surf Gear,0412365987,2]]
PRODUCT
\table[[ProductID,ProductName,Price,Warranty,SupplierID],[Prod111,X500 Kanoe,7189.55,2 year,751],[Prod112,Z200 Goggles,1295.75,1 year,754],[Prod113,K99 GPS Device,2700.21,2 years,753],[Prod114,L55 Moutain Harness,800.25,1 year,752],[Prod115,Aqua Extreme Watch,3050.79,2 years,751]]
SALES
\table[[SalelD,SaleDate,SaleQty,EmplD,CustomeriD],[1010,15 October 2016,10,101,A1005],[1011,18 October 2016,3,103,A1002],[1012,20 October 2016,15,101,A1004],[1013,22 October 2016,21,101,A1001]]
PRODUCT_SALES
\table[[SalelD,ProductID],[1010,Prod111],[1011,Prod112],[1011,Prod111],[1012,Prod115],[1013,Prod112]]
Question 1
(Marks: 6)
Create a SQL query to display the Customer ID, Employee ID, Product ID and the Sale Date of the sale transactions that have a product price of less than R5000.
Question 2
(Marks: 8)
Create a PL/SQL query that will display the Customer Name, Product Name and the Product Price.
In your query only display the products that have a supplier rating of 7.
Question 3
(Marks: 10)
The management of XTREME GEAR SA require a report on the best performing products. Create a PL/SQL query that will display the product names that have a total sales greater than the average sale amount.
Question 4
(Marks: 10)
Create a view called Overall_Report that will display the Employee Name, Customer Name, Product Name, Supplier and the Sale Date. In your query only display the sales that occurred on the 22 October 2016.
Question 5
(Marks: 12)
Create a procedure called Sale_Count that will receive an Employee ID as an input parameter and return the count of the sales made as an output. Your solution must also determine if the performance of the employee is good or poor. If the sale count is greater than or equal to 3 then the performance is considered good, otherwise the performance is poor. In your query use Employee ID 101 as the input parameter and supply the code to run the procedure.
Question 6
(Marks: 12)
Create a function called Lowest_Sales that will display the product name and the lowest sale transaction amount. In your answer also supply the code to run the function.
Question 7
(Marks: 12)
Create a trigger called SupplierEntry that will restrict a user from entering in a Supplier Rating that is less than or equal to zero. In your query also provide a suitable message and the insert statement to test the trigger.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database 101

Authors: Guy Kawasaki

1st Edition

0938151525, 978-0938151524

More Books

Students also viewed these Databases questions

Question

9. YIELD CURVE FOR ZERO-COUPON BONDS RATED AA...

Answered: 1 week ago

Question

What lessons in intervention design, does this case represent?

Answered: 1 week ago