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
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Quick Design Advice?

Author  Topic 

cidr2
Starting Member

28 Posts

Posted - 2009-02-25 : 10:08:55
HI There,

This is a short one and would like someones opionion

I have to create a table that displays info on how much work employees of certain posisions have incurred within the company on a particular project.

For example, a Project Manager may have incurred 5 days of work at a cost of £100 a day. For a Director, the days and costs may be different.

the table schema with both the days and costs would look like this:

Columns
PK ID
FK ID
Project Stages
Assistant Director (Days)
Assistant Director (Costs)
Portfolio Manager (Days)
Portfolio Manager(Costs)
Project Manager(Days)
Project Manager (Costs)
Performance Auditor(Days)
Performance Auditor (Costs)
Project Officer(Days)
Project Officer(Costs)
Others(Days)
Others(Costs)

For each project there would always be 7 rows of info; These rows would seperate the different stages like Fieldwork/research costs incurred. The stages are the Project Stages column

My question is, Do you think I should seperate the Costs and Days into two seperate tables or is the above schema acceptable?


Any advice is always appreciated

Thanks

ahmad.osama
Posting Yak Master

183 Posts

Posted - 2009-02-25 : 14:38:18
quote:
Originally posted by cidr2

HI There,

This is a short one and would like someones opionion

I have to create a table that displays info on how much work employees of certain posisions have incurred within the company on a particular project.

For example, a Project Manager may have incurred 5 days of work at a cost of £100 a day. For a Director, the days and costs may be different.

the table schema with both the days and costs would look like this:

Columns
PK ID
FK ID
Project Stages
Assistant Director (Days)
Assistant Director (Costs)
Portfolio Manager (Days)
Portfolio Manager(Costs)
Project Manager(Days)
Project Manager (Costs)
Performance Auditor(Days)
Performance Auditor (Costs)
Project Officer(Days)
Project Officer(Costs)
Others(Days)
Others(Costs)




Instead of having designations as column names u can have single column say "Designation"

quote:

For each project there would always be 7 rows of info; These rows would seperate the different stages like Fieldwork/research costs incurred. The stages are the Project Stages column



u can have a separate table for project and can use projectid in your main table to refere to projects.

quote:

My question is, Do you think I should seperate the Costs and Days into two seperate tables or is the above schema acceptable?



It depends how u gonna query your data....though with the suggested schema u can have cost and data column in a same table

Any advice is always appreciated

Thanks
[/quote]

u may use this design...

Table1

PKID
FKID
ProjectStageID
Designation
Cost
Days
------------------
Table2

ProjectID
ProjectName
ProjectStageID

-------------------

Table3
ProjectStageID
ProjectStageName

Regards,
Ahmad Osama
Go to Top of Page

cidr2
Starting Member

28 Posts

Posted - 2009-02-26 : 07:17:45
Hi Ahmad and thanks for replying.

I thought about your design idea, and, although is potentially a good idea here, unfortunately due to frontend design issues I've decided to stay with using the Designations as columns and not as rows.

I'm still deciding weather to put the Cost and Days into the same table or make a seperate table.

I don't think it'll make a huge impact whichever way I do it. For reporting I'd use a view anyway to display both columns together, if, in a seperate table.

What's your views, given my decision?

Thanks again:)


Paul

Go to Top of Page

ahmad.osama
Posting Yak Master

183 Posts

Posted - 2009-02-26 : 07:32:17
quote:
Originally posted by cidr2

Hi Ahmad and thanks for replying.

I thought about your design idea, and, although is potentially a good idea here, unfortunately due to frontend design issues I've decided to stay with using the Designations as columns and not as rows.

I'm still deciding weather to put the Cost and Days into the same table or make a seperate table.

I don't think it'll make a huge impact whichever way I do it. For reporting I'd use a view anyway to display both columns together, if, in a seperate table.

What's your views, given my decision?

Thanks again:)


Paul



I understand your concern...but what if u need 5-10 more designation to add....do u really want to create one column for each designation....

in the present scenario it doesn't matters to have in same or separate table.....

Regards,
Ahmad Osama
Go to Top of Page

cidr2
Starting Member

28 Posts

Posted - 2009-02-26 : 08:26:12
I understand, and it's a very valid point. I'm assured these columns will not change or expand (Even though it's not always the case where someone says something and it does).

Your design idea, while good, presents issues of design for the frontend (InfoPath) where I can't get round. Unforunately I have to be realistic about the time management and I think it might take too long to design your suggeted idea around the frontend. Hope you understand.

:)
Go to Top of Page

ahmad.osama
Posting Yak Master

183 Posts

Posted - 2009-02-26 : 13:32:09
quote:
Originally posted by cidr2

I understand, and it's a very valid point. I'm assured these columns will not change or expand (Even though it's not always the case where someone says something and it does).

Your design idea, while good, presents issues of design for the frontend (InfoPath) where I can't get round. Unforunately I have to be realistic about the time management and I think it might take too long to design your suggeted idea around the frontend. Hope you understand.

:)



well...am not pushing you to adapt my suggestion...as you understand your business condition much better than me.....



Regards,
Ahmad Osama
Go to Top of Page

cidr2
Starting Member

28 Posts

Posted - 2009-02-27 : 09:27:43
As far as backend design, your idea to have it as rows and not columns, as far as I'm concerned, is correct.

I'm now working on a way to use the idea and finding a way to have the frontend, consume it as a sort of Pivot table. If that makes sense.

Thanks again:)
Go to Top of Page

ahmad.osama
Posting Yak Master

183 Posts

Posted - 2009-02-27 : 13:33:31
quote:
Originally posted by cidr2

As far as backend design, your idea to have it as rows and not columns, as far as I'm concerned, is correct.

I'm now working on a way to use the idea and finding a way to have the frontend, consume it as a sort of Pivot table. If that makes sense.

Thanks again:)



Okies....am here to help...if u hv any issues...

Regards,
Ahmad Osama
Go to Top of Page
   

- Advertisement -