MySQL Forums
Forum List  »  Data Warehouse

Design Question
Posted by: bob bob
Date: November 27, 2009 09:29AM


I am not sure if this is a data warehouse question or similarly a matter of writing a simple application to use an existing DB. Here goes.

I have a large table with all of the expenses for a company, with one row per expense claim. I have these in a large table. For the sake of this discussion the important items are Userid and Expense amount. For example:

Userid Amount
1 4.5
1 2.4
2 7.9
5 10.2
2 3.2

There is a second table with all of the Userids and their Department:

Userid Department
1 A
2 A
3 B
4 C

Here is what I would to generate for each userid:

Userid, Departmental average expense per user, userid's expense, difference

a) Should I be tackling this with an application to do the work (eg; multiple queries and processing)?

b) Can I think of this as a data warehousing issue and by creating new tables get to my answer? For instance it is easy to create a new table with a userid's total expense. But how to get the same by department?

Thanks very much

Options: ReplyQuote

Written By
Design Question
November 27, 2009 09:29AM
January 04, 2010 05:32PM

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.