Home » SQL & PL/SQL » SQL & PL/SQL » DB Design
DB Design [message #441612] Tue, 02 February 2010 03:17 Go to next message
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 #441614 is a reply to message #441612] Tue, 02 February 2010 03:27 Go to previous messageGo to next message
rahulvb
Messages: 924
Registered: October 2009
Location: Somewhere Near Equator.
Senior Member
Take a look at Sample Schema

* Schema Design is Always driven by the Purpose of application.
Re: DB Design [message #441617 is a reply to message #441612] Tue, 02 February 2010 03:38 Go to previous messageGo to next message
pablolee
Messages: 2813
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 Go to previous message
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
Previous Topic: BLOB
Next Topic: Why DBMS_CHANGE_NOTIFICATION
Goto Forum:
  


Current Time: Tue Sep 27 19:32:38 CDT 2016

Total time taken to generate the page: 0.06476 seconds