944,010 Members | Top Members by Rank

Ad:
  • Oracle Discussion Thread
  • Unsolved
  • Views: 1559
  • Oracle RSS
Sep 30th, 2009
0

sql using oracle

Expand Post »
This is a problem that is killing me. It is a school assignment and I can't figure it out so any help will be great. I have eleven questions, and I have five of them answered.
I have these tables with these fields:
Table:sales_rep
Columns:Last|First|Street|City|St|Zip_Code|Total_Commision|Commision_Rate
Table:customer
Columns:Last|First|Street|City|St|Zip_Code|Balance|Credit_Limit|slsrep_number
Table:part
Columns: Part_number|part_description|Units_on_hand|it|warehouse_number|unit_price
Table:orders
Columns:Order_Number|order_date|customer_number
Table:order_line
Columns:Order_Number|part_number|number_ordered|quoted_price
Now here is my questions along with the ones I have answers to.

Find the last name and first name for every customer who has a credit limit of at least $800.
Oracle Syntax (Toggle Plain Text)
  1. SELECT last,first FROM customer WHILE credit_limit>799;



Give the order number for every order placed by customer number 124 on 9/05/1998.
Oracle Syntax (Toggle Plain Text)
  1. SELECT order_number FROM orders WHILE order_date='05-SEP-02';


List the customer number, last name, and first name for every customer represented by sales rep 03 or sales rep 12.
Oracle Syntax (Toggle Plain Text)
  1. SELECT customer_number,last,first FROM customer WHILE slsrep_number=3 AND slsrep_number=12;


List the part number and part description for every part that is not in item class HW.
Oracle Syntax (Toggle Plain Text)
  1. SELECT part_number,part_description FROM part WHEN it <>'HW';


List the part number and part description for every part that has between 100 and 200 units on hand.
Oracle Syntax (Toggle Plain Text)
  1. SELECT part_number,part_description FROM part WHERE units_on_hand>99 AND units_on_hand<201


From here I'm lost can anyone give me some help. Please.
List the name of all customers who has a balance less than their credit limit.
Oracle Syntax (Toggle Plain Text)
  1. SELECT last,first FROM customer WHERE balance<credit_limit;


For every order, list the order number, order date, part number, part description, and number of units ordered.



Find the customer number, last name nad first name for every customer who currently has an order on file for an iron.



List the part description, part number, order number and order date for every order placed by Mary Nelson that does not contain an order line for a treadmill. You must use the set operation of minus to do this problem.



List the order number and order date for every order that was placed by Mary Nelson or that contains an order line for an iron. You must use the set operation of union to do this problem.



List the order number and order date for every order that was placed by Mary Nelson and contains an order line for an iron. You must use the set operation of intersection on this problem.
Last edited by peter_budo; Oct 1st, 2009 at 5:39 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
scuzzo is offline Offline
8 posts
since Apr 2009
Oct 6th, 2009
0
Re: sql using oracle
I think you are trying to redefine SQL with your own bunch of syntax. What are those WHILE and WHEN in your code ?
Featured Poster
Reputation Points: 665
Solved Threads: 427
Posting Genius
debasisdas is offline Offline
6,406 posts
since Feb 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Oracle Forum Timeline: Beginner Oracle Help
Next Thread in Oracle Forum Timeline: Help cursor/procedure





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC