Answered step by step
Verified Expert Solution
Question
1 Approved Answer
STOCK table [ [ STOCK _ ID , STOCK _ TYPE,STOCK _ MODEL,MANUFACTURER ] , [ 1 2 3 4 5 , Desktop,Proline K
STOCK
tableSTOCKIDSTOCKTYPE,STOCKMODEL,MANUFACTURERDesktop,Proline KAcerLaptop,JMecerServer,HPSamsungLaptop,Aspire HPNotebook,LLenovo
CUSTOMER
tableCUSTIDCUSTFNAMECUST SNAME,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 Tme taken todiagnose problemJULBattery Replaced,JULOS Upgraded,JULFaulty hard disk replaced,JUL
SALES
tableSALES NUM,SALESDATE,SALESAMT,STOCKIDCUSTIDREPAIRIDJULR CJULR CJULR CJULR CJULR C
QUESTION
CREATE AND POPULATE THE TAABLES
Question
Marks:
TASK: Query Time taken to complete Repairs.
Using SQL only, display the combined customer name, the repar work, repair date and repair hours. In your query only display the results that had a repar time less than hours
Question
Marks:
TASK: Query Sales Made
Using PLSQL display the Customer ID Slock Type and the Sales Amount. In your query only display the results where the sales amount is less th
Question
TASK: Query Calculate Commission
Marks:
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 vill prevent a user from entering a sales amount that is less than zero. In your query include the code to test the trigger.
Question
Marks:
TASK: Create Stored Procedure
Create a stored procedure called spcustomerdetails that accepts sales and display the customer id customer first name, sumame and their contact number.
In your solution display the data for any custorner 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 input parameter 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
Question
Marks:
TASK: Database Security Mini Presentation
At the moment, the management requires a mini presentation on how you would acheve data security. Provide at least five ways you would ensure database secunty referring to the case study in your answer
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