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
 Database schema design help

Author  Topic 

Apples
Posting Yak Master

146 Posts

Posted - 2011-01-06 : 17:32:42
I have a table named "Printers".

For each printer, I need to keep track of the speed it handles certain paper, and the time it takes to get the printer ready for certain paper. There are 3 types of paper - thin, normal, and thick.

So I don't know if I should just add columns to Printers called "SpeedThin", "SpeedNormal", "SpeedThick", "MakereadyThin", "MakereadyNormal", "MakereadyThick"

- or -

Create a PaperType table:

--------------------------------
PaperType
--------------------------------
PaperTypeID | Name
--------------------------------
1 | Thin
2 | Normal
3 | Thick

Then create a MachineSpeed and MachineMakeready table

--------------------------------
MachineSpeed
--------------------------------
MachineSpeedID | MachineID | PaperTypeID | Speed
--------------------------------
1 | 1 | 1 | 20
2 | 1 | 2 | 30
3 | 1 | 3 | 40



What should I do here?

Kristen
Test

22859 Posts

Posted - 2011-01-06 : 18:08:08
Is there even a remotely slim possibility that there will be printers in the future that will handle more than three thicknesses of paper?

If so then without-a-doubt you need the separate tables.

If not then ... you probably still need the separate tables but you could get away with columns, but best not to tell anyone, and in particular don't announce it on a public forum where there are purists, and don't tell anyone I told you it was OK, OK?
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-01-08 : 01:27:59
I would really prefer to do it way you've ie having separate table with paper types.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -