Welcome Guest, Not a member yet? Register   Sign In
Help modeling assignments
#1

[eluser]pabloheim[/eluser]
Hi,
im developing a mini app where a boss assigns a task to some members of the staff. each member has an id and a name. The task has an id too.

In your opinion, what is the best way to store in a databse the link between a task and the part of the staff that have to solve it?

for example, my first idea was this:
the tasks table has a column called team that is a string like this: "1,4,8" .This means that members whose id are 1, 4 and 8 have to solve the task. This is easy to insert, but a little difficult to extract (lack of flexibility)

i have another idea : imagine we have a table called assignments. it has two columns : "task_id" and "member_id". If the boss asks members 1, 4,8 to solve the task "30", then this is stored like this:

Code:
---------------------
task_id | member_id |
---------------------
  30    |      1
---------------------
  30    |      4
---------------------
  30    |      8
---------------------

This solution is easy for extract : select member_id where task_id="30"
but a little bit difficult to insert.

What do you think??

Thanks in advance and sorry for my english.


Messages In This Thread
Help modeling assignments - by El Forum - 08-16-2009, 04:44 PM
Help modeling assignments - by El Forum - 08-16-2009, 05:00 PM
Help modeling assignments - by El Forum - 08-16-2009, 05:04 PM
Help modeling assignments - by El Forum - 08-17-2009, 07:55 PM
Help modeling assignments - by El Forum - 08-17-2009, 08:02 PM
Help modeling assignments - by El Forum - 08-17-2009, 08:39 PM



Theme © iAndrew 2016 - Forum software by © MyBB