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

[eluser]jedd[/eluser]
Howdi,

You are correct - strings containing multiple integers, separated by commas .. is not a good way of recording this information.

Quote: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:

You are on the right track here. Typically you would have an id column, AUTO-INC, UNIQUE, etc - as your primary key.

And you'd call the table by the name of the two tables you're connecting - so member_task (usually alphabetical ordering). This is a bit traditional Active Record (as opposed to CI's AR) but consistency is good, and their standard is as good as any. You'd also make the two columns you've mentioned here as INDEX, of course.


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

What cases do you see inserts to be difficult for?


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