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.
Author |
Topic |
cornall
Posting Yak Master
148 Posts |
Posted - 2010-01-28 : 14:47:16
|
Hi,I was wondering peoples opinion on the best way to tackel my problem.I have a database table activity and table resourcee.g. Activity ID Activity Name cost/hour 1 an activity 10 2 a n other activity N/AResource ID Resource Name cost/hour 1 an activity 10 Cost of an activity can be calculated in two wayseither User selects an activity and enters I need x times activity y with productivity of z activities per hour giving costx/z * (cost) y10/5 = 2 hours -> 2 * 10 = £20orUser selects an activity and says resource x will do activity y for z hours(cost) x * z 10 * 10 = £100So I have my data and I ahve my bussiness logicQuestion 1 is it a good idea to mix activities that have a fixed cost and are calculated by productivity in the same table as activities that have no price and are perfromed by resoures with a cost per hour?Next question should I store the calculates values in SQL or calculate them on the fly evey time a quote is opened in the system?If I should store them in the DB how should I structure my tables?If not arguments why I should calculate on the fly.Cheers D |
|
|
|
|