Beginner |
|
Joined: Fri May 11, 2007 11:03 am Posts: 32
|
I am facing a unique problem. I have three different tables say Task, StepGroup and Step. The relation between these tables is a many to many. In other words :a Task can have number of StepGroups and also a number of Steps. :a StepGroup can have a number of Steps and also can be in a number of Tasks : a Step can be in a number of Tasks and also in a number of StepGroups
Uptill this, its fine and I am able to get things to work. To acomplish this I have three join tables between them. Now not only a Task can have a number of StepGroups and Steps. They need to be in a specified order. Example : Task1 can have-- Step1 StepGroup2 Step5 Step9 in that order
Task2 can have-- Step5 StepGroup1 StepGroup4 Step6 in that order
I am having hard time to reflect this in the database. One thing I could think of was to make another table in which there would be three columns being three foreign keys from three different table where one would make sure that either one of the step and stepgroup foreign keys would be null for a given row.And it would have an id column which would determine the order. But I dont know would it be the right thing to do?
Could somebody suggest a good database design in order to accomplish this releationship.
|
|