I have an issue
There a table that's called "Routing" this table is for routing a task for three category of object
–
- Analyser (interne machine)
– -
subcontractor (externe )
-
Manually (interne worker)
how to design a relation between 5 tables
1 - task table -> Routing table -> - analyser table
- subcontractor table
- Interne user table
Edit:, answers to questions in comments:
-
Can a task have many routings? Can a routing belong to many tasks or just one?
No, atask
is routed to onerouting
(the routing is the manner to know where the task should be done). -
Is there an Analyzer, a Subcontractor and an Interne (ManualWorker) table?
Yes, there is ananalyser
table, andsubcontractor
table, andinterne
table. -
Can an analyser be part of many routings (of the same task)?
Yes, ananalyser
can be a part of manyrouting
. -
Can a subcontractor take part in many routings of the same task?
No, asubcontractor
(oranalyser
orinterne
) take to onerouting
of thetask
(the task is routed to one subctr, or analyser or in interne).
Best Answer
If I have understood what you need is:
TASK TABLE: ID, NAME, DESCR and other attributes
ROUTING TABLE: *ID, IDTASK, INFO and other attributes**
ANALYSER TABLE: ID, IDROUTING and other attributes
SUBCONTRACTOR TABLE: ID, IDROUTING and other attributes
INTERNE USER TALBE: ID, IDROUTING and other attributes
if you want to trace better the relations, you can add in ROUTING TABLE also 3 foreign key like IDANALYSER, IDSUBCONTRACTOR and IDINTERNEUSER. This is not very efficient, because you will have always 2 values null and only one with a value.
But, you can go straight from ROUTING TABLE to the right detailed table.