×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Table Relation Question

Table Relation Question

Table Relation Question

(OP)
Let's say a user wants to perform TaskA. In order to completely perform TaskA, TaskB, TaskC, and TaskD need to be completed also and in that order. If the user wants to complete, say, TaskQ, in order to fully complete TaskQ, they will need to completely perform TaskM, TaskN, TaskO, TaskP.

I was thinking something like this:

tblMajorTask
  MajorTaskId
  TaskName
  OtherFields

tblMinorTaskLink
  MajorTaskId
  MinorTaskId

tblMinorTask
  MinorTaskId
  TaskName
  Other Fields

However, minor tasks can actually be a Major task too...just depends on the user's starting point and their intended goal (e.g. the user could have started with TaskB, then to complete taskB, they would only have to complete TaskC and TaskD). So, I kind of wrote off the idea of Major and Minor tasks. Then I thought...hey...if only a task could have a 1 to Many relationship with iteself...only in my mind I can't see to get a grip on that. Can you do that? Does that work as a design? Are there flaws/downfalls this newbie can't see?

Thanks in advance!
 

RE: Table Relation Question

no reason why a table can't have a many-many relationship with itself...

tasks ( taskID, taskName ... )
taskLink ( thisTaskID, parentTaskID, ... )

you will need some function to link back through tasks to build a tree, but that's pretty standard and you can find examples quite easily...

--------------------
Procrastinate Now!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close