here is a structure of tables in a database
CUSTOMERS (CustID*, CompanyName, ContactName, ContactTitle, Address,
City, Region, PostalCode, Country, Phone, Fax)
EMPLOYEES (EmployeeID*, Lastname, Firstname, Title, TitleofCourtesy,
Birthdate, Hiredate, Address, City, Region, Postalcode, Country,
Homephone, Extension, Reportsto)
ORDERS (OrderID*, CustID, EmployeeID, OrderDate, RequiredDate,
ShippedDate, ShipVia, Freight, ShipName, ShipAddress, ShipCity,
Shipregion, ShipPostalCode, ShipCountry)
ORDER_DETAILS (OrderID*, ProductID*, UnitPrice, Quantity, Discount)
PRODUCTS (ProductID*, ProductName, SupplierID, PL_ID, QuantityPerUnit,
UnitPrice, UnitsInStock, UnitsOnOrder, ReorderLevel, Discontinued)
PRODUCT_LINES (PL_Id*, PL_Name, Description)
SHIPPERS (ShipperID*, CompanyName, Phone)
SUPPLIERS (Supplierid*, Companyname, Contactname, Contacttitle,
Address, City, Region, Postalcode, Country,Phone,Fax)
* - Primary keys
queries (these are problem questions given in a competition!!!)
1.) In which month of 1997 was the most number of orders placed? List
the month, number of orders placed during that month , number of
customers who placed orders in that month , gross (i.e. disregard
discount) total value of orders placed .
2.)
Determine the products for which there has been at least one
order during each month of 1997. Display for these products: the
Product ID, Product name, Product Line Name, number of orders placed
during 1997 , number of customers who have ordered the product in 1997
, and gross (i.e. disregarding discount) total value of orders placed
for the product in 1997 .
3.) Find the customers who have placed orders during 1996 & 1997 for
products in every product line AND who have had their orders handled
by either all employees or all but one employee. Display the customer
ID, company name, address, city, country and number of orders placed
4.) For each product line, find the top three customers (based on
maximum total purchase value; ignore discounts). Display the Product
Line name, the Customer ID & Company name, and the total purchase
value for that customer in the product line . Sort the output by
Product Line and within that, the line revenue figure (highest first).
i think rank() shud b used
any clues/ideas ??? 6 2355
On 6 Mar 2004 02:15:00 -0800, us********@yahoo.com (dada) wrote: any clues/ideas ???
Go to class more often?
--
Mike Sherrill
Information Management Systems
"dada" <us********@yahoo.com> wrote in message
news:f7**************************@posting.google.c om... here is a structure of tables in a database
This is not a structure of any sort of daatabase. There's nothing here
about datatypes.
Is CustID a character field? A numeric, or something else?
There's no sample data either.
Do your homework and then come back with proper DDL and example data and
then perhaps folks can help. CUSTOMERS (CustID*, CompanyName, ContactName, ContactTitle, Address, City, Region, PostalCode, Country, Phone, Fax)
EMPLOYEES (EmployeeID*, Lastname, Firstname, Title, TitleofCourtesy, Birthdate, Hiredate, Address, City, Region, Postalcode, Country, Homephone, Extension, Reportsto)
ORDERS (OrderID*, CustID, EmployeeID, OrderDate, RequiredDate, ShippedDate, ShipVia, Freight, ShipName, ShipAddress, ShipCity, Shipregion, ShipPostalCode, ShipCountry)
ORDER_DETAILS (OrderID*, ProductID*, UnitPrice, Quantity, Discount)
PRODUCTS (ProductID*, ProductName, SupplierID, PL_ID, QuantityPerUnit, UnitPrice, UnitsInStock, UnitsOnOrder, ReorderLevel, Discontinued)
PRODUCT_LINES (PL_Id*, PL_Name, Description)
SHIPPERS (ShipperID*, CompanyName, Phone)
SUPPLIERS (Supplierid*, Companyname, Contactname, Contacttitle, Address, City, Region, Postalcode, Country,Phone,Fax)
* - Primary keys
queries (these are problem questions given in a competition!!!)
1.) In which month of 1997 was the most number of orders placed? List the month, number of orders placed during that month , number of customers who placed orders in that month , gross (i.e. disregard discount) total value of orders placed .
2.) Determine the products for which there has been at least one order during each month of 1997. Display for these products: the Product ID, Product name, Product Line Name, number of orders placed during 1997 , number of customers who have ordered the product in 1997 , and gross (i.e. disregarding discount) total value of orders placed for the product in 1997 .
3.) Find the customers who have placed orders during 1996 & 1997 for products in every product line AND who have had their orders handled by either all employees or all but one employee. Display the customer ID, company name, address, city, country and number of orders placed
4.) For each product line, find the top three customers (based on maximum total purchase value; ignore discounts). Display the Product Line name, the Customer ID & Company name, and the total purchase value for that customer in the product line . Sort the output by Product Line and within that, the line revenue figure (highest first). i think rank() shud b used
any clues/ideas ???
At any of the universities I have attended or taught at, attempting to
present the work of other people as your own work is grounds for
expulsion or termination.
A few years back, I filed a compliant against a student at a University
in New Zealand for this. I do not know what action was against him.
--CELKO--
===========================
Please post DDL, so that people do not have to guess what the keys,
constraints, Declarative Referential Integrity, datatypes, etc. in your
schema are.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Greg D. Moore (Strider) (mo****************@greenms.com) writes: This is not a structure of any sort of daatabase. There's nothing here about datatypes.
Is CustID a character field? A numeric, or something else?
There's no sample data either.
Of course there is! Don't you recognize Northwind when you see it?
--
Erland Sommarskog, SQL Server MVP, so****@algonet.se
Books Online for SQL Server SP3 at http://www.microsoft.com/sql/techinf...2000/books.asp
"Erland Sommarskog" <so****@algonet.se> wrote in message
news:Xn*********************@127.0.0.1... Greg D. Moore (Strider) (mo****************@greenms.com) writes: This is not a structure of any sort of daatabase. There's nothing here about datatypes.
Is CustID a character field? A numeric, or something else?
There's no sample data either. Of course there is! Don't you recognize Northwind when you see it?
Touche. I'll go slink back into my corner now. :-) -- Erland Sommarskog, SQL Server MVP, so****@algonet.se
Books Online for SQL Server SP3 at http://www.microsoft.com/sql/techinf...2000/books.asp
Hi Joe,
the world is full of people trying to make something to survive, why
somes few others giving orders to, says "this is what I have done..."
Don't you recognize G. Bush and american soldiers ???
French humour, you can say !
A +
Joe Celko a écrit: At any of the universities I have attended or taught at, attempting to present the work of other people as your own work is grounds for expulsion or termination.
A few years back, I filed a compliant against a student at a University in New Zealand for this. I do not know what action was against him.
--CELKO-- =========================== Please post DDL, so that people do not have to guess what the keys, constraints, Declarative Referential Integrity, datatypes, etc. in your schema are.
*** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!
--
Frédéric BROUARD, MVP Microsoft SQL Server. Langage SQL / Delphi / web
Livre SQL - col. Référence : http://sqlpro.developpez.com/bookSQL.html
Le site du SQL, pour débutants et pros : http://sqlpro.developpez.com
****************** mailto:br******@club-internet.fr ****************** This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Andreas Lauffer |
last post by:
I changed from Access97 to AccessXP and I have immense performance
problems.
Details:
- Access XP MDB with Jet 4.0 ( no ADP-Project )
- Linked Tables to SQL-Server 2000 over ODBC
I used...
|
by: Roger Green |
last post by:
I have inherited a complex database that has many dozens of queries that derive data from a people
table.
I now need to be able to run these queries (from within a significant number of forms)...
|
by: NeilAnderson |
last post by:
I'm a fairly new user of access & I've never had any training, so I'm
wondering if I'm doing the right thing here, or if it matter at all.
I'm building a database for room booking purposes and I'm...
|
by: Jerry Hull |
last post by:
I'm working with a database developed by an untrained person over
several years - and on a network that has recently been upgraded with
a new server installed and MS office upgraded from 2K (I...
|
by: Greg Strong |
last post by:
Hello All,
Is it better to create a query in DAO where a report has 4 sub-reports
each of whose record source is a query created at runtime and
everything is in 1 MDB file?
From what I've...
| |
by: George |
last post by:
Was my question too challenging for everyone? I thought I would get a much quicker response, complete with witty and (sometimes) condescending remarks
Here's my question again, in case you missed...
|
by: Frankie |
last post by:
I have been hired to go to a former client of mine and train their staff
programmers on ASP.NET. These guys have only Mainframe, MS Access, SQL
Server, and VB6 desktop application development...
|
by: alainpoint |
last post by:
Hi,
I have what in my eyes seems a challenging problem.
Thanks to Peter Otten, i got the following code to work. It is a sort
of named tuple.
from operator import itemgetter
def...
|
by: mukeshrasm |
last post by:
Hello Every One
I have a simple problem. I want that admin or user cannot enter data to database more than a specific number of records (say 10). Means he/she can not enter data to the database...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |