Hi everyone,
I'm currently building a "small" web-application ... it's small compared to what's out there, but would be my first project of this scale.
I'm familiar with ER Diagrams and most of the lingo however I'm not sure if I have the right model at the moment.
I have the following tables:
-Customer
-Contract
-ContractType
Customer have a n:m relationship to a Contract table.
Contract have a 1:n identifying relationship to a ContractType table.
Now my problem is with the contracts, depending on the type I will store different informations.
Say ContractType_1 (A la carte) will store a nbOfHours and costPerHours, etc.
ContractType_2 will store a Project with an associated cost, etc.
I was gonna do two tables, one for each type of table and have a n:m relationship for each between them and contract.
Second option would be larger table with a hell of a lot of NULLs depending on the contract type...which sounds wrong to me.
Third, ditch the contract model all together and have each ContractType as a primary table with a n:m to Customer
Am I just missing the big picture here?
Thanks in advance, I hope the post was clear. If I left out any required information don't hesitate to ask for precision.
I'm currently building a "small" web-application ... it's small compared to what's out there, but would be my first project of this scale.
I'm familiar with ER Diagrams and most of the lingo however I'm not sure if I have the right model at the moment.
I have the following tables:
-Customer
-Contract
-ContractType
Customer have a n:m relationship to a Contract table.
Contract have a 1:n identifying relationship to a ContractType table.
Now my problem is with the contracts, depending on the type I will store different informations.
Say ContractType_1 (A la carte) will store a nbOfHours and costPerHours, etc.
ContractType_2 will store a Project with an associated cost, etc.
I was gonna do two tables, one for each type of table and have a n:m relationship for each between them and contract.
Second option would be larger table with a hell of a lot of NULLs depending on the contract type...which sounds wrong to me.
Third, ditch the contract model all together and have each ContractType as a primary table with a n:m to Customer
Am I just missing the big picture here?
Thanks in advance, I hope the post was clear. If I left out any required information don't hesitate to ask for precision.