DB Design [message #441612] |
Tue, 02 February 2010 03:17  |
bmayr
Messages: 8 Registered: February 2010
|
Junior Member |
|
|
Hi! I am thinking about a good DB-Design concerning the following challenge:
I'd like to store objects which concern different departements in the company. Each departement hast to decide about what to do whith the object. This is done via a status-code (discard, accept, implement, etc.)
This leads to the following construct:
1 object affects 1..* departements
Each departement can set a status code to the affecting objects
My Problem is: How to store the different stati of one object within a proper db-design?
objects - departements is rather simple.
Tab1: objects (id, name, ...) PK-->id
Tab2: departments (id, name, ...) PK-->id
Tab3: obj_dep_relation (objId, depId) PK-->objId,depId
But how to store the stati?
Would the following 4th table be a good solution?
Tab4: dep_stati_relation (obId, depId, status) PK-->obId,depId
Great Thanks!
|
|
|
|
Re: DB Design [message #441617 is a reply to message #441612] |
Tue, 02 February 2010 03:38   |
pablolee
Messages: 2882 Registered: May 2007 Location: Scotland
|
Senior Member |
|
|
seems to me that there is a 1 to 1 relationship between Status and Object/Department. If that is the case, then place the status in table3
|
|
|
Re: DB Design [message #441618 is a reply to message #441617] |
Tue, 02 February 2010 03:43  |
bmayr
Messages: 8 Registered: February 2010
|
Junior Member |
|
|
Thanks, your hint was a great help to me!
Reconcerning the problem, this solutions seems very clear
|
|
|