Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Conceptual SQL advice.

Author  Topic 

SergioM
Posting Yak Master

170 Posts

Posted - 2014-05-06 : 12:21:43
I have a task that conceptually, I'm not sure how to handle.

I am working on an inventory management software. Buyers are related to their purchases. The inventory from those purchases is related to the orders & the orders are related to profit. I need to figure out how much profit, buyer X has generated in the past month.

The problem is that inventory and sales do not have a 1:1 relationship. A buyer might buy some stock, sell half, then another buyer gets more stock from another vendor at a lower price, etc... Now inventory is shared amongst two buyers. Is there a creative way to work that out? I could use FILO (first in last out), but this company cost averages their inventory. Thoughts?

-Sergio
I use Microsoft SQL 2008

gbritton
Master Smack Fu Yak Hacker

2780 Posts

Posted - 2014-05-06 : 12:46:29
Start with an ERM diagram. When you've got that, build out a schema for your db. Then, work out how to populate the db, how to update it and lastly how to report on it.

Without this basic, it's going to be pretty hard to give any more advice
Go to Top of Page
   

- Advertisement -