aggregate functions HELP!

  • Thread starter Thread starter csharp_babyboi
  • Start date Start date
C

csharp_babyboi

Hello to all,

I am new at writing queries. I am working on an application for a
bookstore. What I need is a query that will allow me to display the top
10 percent of all the authors based on books sold, and the top 10
percent of all customers based on the amount of dollars spent. Assuming
that I have a table CUSTOMERHISTORY containing the customer's buying
history, and another table TRANSACTIONS which contains all of books
bought, how would go about constructing these two queries?

Thank you,

-csbb

..net 4ever
 
Thank you for replying....

CustomerHistory
______________
CusHistIdNum
IsbnNum
PubIdNum
DateOfOrder
DateOfDelivery
QuantityDelivered
Components


Transactions
_____________
TransactionNum
PubIdNum
NumBooksSold
TransactionTotal
 
I don't see any author data in these tables? How do you identify the authors
so that you could determine the "highest selling" authors?

Is CusHistIDNum a unique value for the CustomerHistory table? If yes, then
how do you get customer data / information?

We will need additional tables to do this query correctly. Those tables need
to allow the gathering of customer and author information.
 
Back
Top