PL/SQL i need help
hi can anyone help to do this task?
Tiny Toys is a company that sells toys to schools and nurseries by mail order. Orders are taken over the phone by a number of sales consultants. The company already have a database with five tables set up. Table names and their columns are shown below:
TOYS (Toy_ID, Description, Rec_Retail_Price)
CUSTOMERS (Customer_ID, Name, Address, City, County, Post_Code, Account, Sales_Consultant_ID)
LINEITEMS (Order_ID, Toy_ID, Price, Quantity, Quantity_Sent)
ORDERS (ID, Customer_ID, Order_Date, Date_Sent, Sales_Consultant_ID, Total, Payment_With_Order, Order_Filled)
SALES_CONSULTANTS (ID, Last_name,First_name)
The above tables and the data can be found in k:\work\computing\Beryl Jones\plsqlcwk.sql. In order to do this assignment, you will need to create these tables in your own schema using the above script.
YOUR TASK
1. Write a procedure (not an anonymous block) to display details of all of the orders for a specific customer along with the customerâs name. The customerâs name should only be displayed once regardless of how many orders they have placed and should be passed into the procedure as a parameter. For each order the following details should be displayed :
⢠order_id
⢠order_date
⢠date_sent
⢠total
⢠order_filled
2. Write a procedure (not an anonymous block) to calculate and display the total commission earned by a specific sales consultant on all the orders they take. The commission rate is 5% per order and you must write a function to calculate the actual commission value. The name of the sales consultant must also be displayed.
3. Write a procedure (not an anonymous block) to display details of all the line items for a specific order and include the toy description in the output. The order_id should be passed into the procedure as a parameter. For each line item the following details should be displayed:
⢠order_id
⢠toy_id
⢠description (of the toy)
⢠price
⢠quantity
⢠quantity_sent
|