Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > Oracle
|
Oracle General Oracle database discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Oracle section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 3rd, 2004, 10:18 AM
Registered User
 
Join Date: Dec 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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



 
Old December 3rd, 2004, 10:28 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

It's homework time...



--

Joe (Microsoft MVP - XML)
 
Old January 5th, 2005, 11:38 AM
Authorized User
 
Join Date: May 2004
Posts: 28
Thanks: 0
Thanked 1 Time in 1 Post
Default

Quote:
quote:Originally posted by joefawcett
 It's homework time...

We wouldn't mind so much its the fact you left all of the references to the drives in.

Reminds me of a time I was at College, we had a number of reference books one of which was very useful. You could basically use a chapter to write each assignment, most of us simply used it as a guide and added more info from other soures and changed it enough so it became unrecognisable. But 3 people got a scanner and scanned it in word for word. The thing is I don't think the lecturers would have noticed if it wasn't for the fact it has "see figure 1.1" all over the place where that had left out the picturers.


 
Old January 6th, 2005, 01:14 AM
Registered User
 
Join Date: Dec 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to maneeshgautam Send a message via MSN to maneeshgautam Send a message via Yahoo to maneeshgautam
Default

Hi,

You said,
"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."

So can you send the plsqlcwk.sql please?

Thanks and regards
-Maneesh






Similar Threads
Thread Thread Starter Forum Replies Last Post
PL/SQL Somesh ASP.NET 1.0 and 1.1 Basics 7 December 15th, 2006 05:49 PM
PL/SQL Cursor help Wikked Oracle 1 March 12th, 2005 01:19 AM
PL/SQL cooldude87801 Oracle 1 March 3rd, 2005 10:54 AM
PL/SQL help carly_1 Oracle 1 October 19th, 2003 08:14 PM
PL/SQL help Blue Oracle 0 August 12th, 2003 02:54 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.