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
 Database Design and Application Architecture
 Simple Schema question

Author  Topic 

cidr
Posting Yak Master

207 Posts

Posted - 2010-11-08 : 05:17:49
Hi there,

I was just wanting to know what people thought would be the best conclusion to the schema question.

The report I'm developing has three requirements; show the performance of contractors and sub contractors that have been called out to complete jobs.

The performance would be measured on first fix, response (if Engineer was called out on time), and repair (repaired on time)

The report will display national performance which is contractor/subcontracor together as a top level figure and two other sections - one with each contractor performance and one with each subcontractor performance.

I'd like to know if you had this senario, would you use three seperate tables to store the data (National, Contractor and Subcontracot) or would you use the same table and maybe have an ID to distiguish each group?

Any thoughts on this would be a great help.

Cheers

Lumbago
Norsk Yak Master

3271 Posts

Posted - 2010-11-08 : 06:37:10
If the columns for each contractor type are the same you should put them all in one table and separate them by a ContractorType column or something. You could also add the id of the parent of a subcontractor to keep track of the hierarchy (if there is one).

- Lumbago

My blog (yes, I have a blog now! just not that much content yet)
-> www.thefirstsql.com
Go to Top of Page

cidr
Posting Yak Master

207 Posts

Posted - 2010-11-08 : 06:40:27
Thanks Lumbago! very helpful:)
Go to Top of Page
   

- Advertisement -