Re: Help!! Having trouble database queries!!
Hi there!
[These are Oracle table definitions - you sure you have the right forum? (I know you don't, this forum is about saying goodbye to Oracle and hello to MySQL...)]
)
Write a query to list the customer name and the number of orders they have placed. Include any customers that have not placed orders. Sequence the list by the customer number.
select c.name
, count(so.custno)
from customer c
, SalesOrder so
where c.cust_no = so.cust_no (+)
order by c.cust_no
this is the ancient syntax - works in every oracle version around. As of version Oracle 9, you can use ansi join syntax:
select c.name
, count(so.custno)
from customer c
left join SalesOrder so
on c.cust_no = so.cust_no
order by c.cust_no
this works in most other rdbms-es too.
Sorry- got to go right now - maybe I'll answer the other question too when I get back
CU
b)
Write a query to list parts (identity number and first 20 characters of the description) and the total quantity ordered for each part and total value relating to those quantities. Include any parts that have not been ordered. Sequence the list in alphabetical order of description.
Subject
Views
Written By
Posted
4410
February 23, 2006 03:08PM
Re: Help!! Having trouble database queries!!
2100
February 24, 2006 09:21AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.