Answered step by step
Verified Expert Solution
Question
1 Approved Answer
please help using SQL plus or SQL developer STOCK table [ [ STOCK _ ID , STOCK _ TYPE,STOCK _ MODEL _ , MANUFACTURER
please help using SQL plus or SQL developer
STOCK
tableSTOCKIDSTOCKTYPE,STOCKMODELMANUFACTURERDesktop,Proline KAcerLaptop,MecerServer,HPSamsungLaptop,Aspire HPNotebook, L lenovo
CUSTOMER
tableCUST IDCUSTFNAMECUSTSNAME,CUSTADDRESS,CUSTCONTACT,CJeff,Willis, Main Road,CAndre,Watson, Cape Road,CWallis,Smith, Mountain Road,CAlex,Hanson, Circle Road,CBob,Bitterhout, Main Road,CThando,Zolani, Summer Road,CPhilip,Jackson, Long Road,CSarah,Jones, Sea Road,
REPAIRS
tableREPAIRIDREPAIRWORK,REPAIRDATE,REPAIRHOURSHD defragmentation,JULtableRAM module replaced. Time taken todiagnose problemJULBattery Replaced,JULOS Upgraded,JULFaulty hard disk replaced,JUL
SALES
tableSALESNUM,SALESDATE,SALESAMT,STOCKIDCUSTIDREPAIRIDJULR CJULR CR CJULR CJULR C
QUESTION
CREATE AND POPULATE THE TABLES
Question
Marks:
TASK: Query Time taken to complete Repairs.
Using SQL only; display the combined customer name, the repair work, repair date and repair hours. In your query only display the results that had a repair time less than hours.
Question
Marks:
TASK: Query Sales Made
Using display the Customer ID Stock Type and the Sales Amount. In your query only display the results where the sales amount is less than R
Question
Marks:
TASK: Query Calculate Commission
IT Gear Dealer has a policy that states that, for any individual sale made, the employee who completed the repair work receives a certain commission.
Using PLSQL display the Customer ID Stock ID Sales Number, the Repair ID the Sales Amount, and the commission payable which will be calculated as follows:
For an individual sale of R or less, apply a commission.
An individual sale between R and R apply a commission.
An individual sale of R or more, apply a commission.
Question
Marks:
TASK: Create View
Create a view called RepairView that will display the combined Customer Name, Stock ID Repair Date and the Repair Work done. In your query also include the statement to run the view.
Question
Marks:
TASK: Create Trigger
Create a Trigger called SalesEntry that will prevent a user from entering a sales amount that is less than zero. In your query include the code to test the trigger.
Question
TASK: Create Stored Procedure
Marks:
Create a stored procedure called spcustomerdetails that accepts sales and display the customer id customer first name, surname and their contact number.
In your solution display the data for any customer and provide the code to execute the procedure with relevant exception handling and relevant code comments.
Question
Marks:
TASK: Create Function
Create a function called fnITGear that would be meaningful and relevant for this database. Your function should accept at least inputparameter and display at least relevant pieces of information:
In your solution,
display the data and provide the code to execute the function.
use relevant exception handling and
provide relevant code comments
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started