Help with relationship

diego.gsantos

Registered User.
Local time
Today, 13:09
Joined
Sep 25, 2013
Messages
14
Hello everyone.

I need some help in how to do the following:

In my application, users will input data about tasks that they do.

Each task can be of a kind.

And each kind has specific attributes that may vary


One of these kinds, the user DO not insert data, instead, the application will give him "code"

How should I structure this?

I have these tables:

TASKS < receive user ID from USERS

TASKS < receive kindID from TASK_KINDS (and receive the info like "has_code" y/n)

Do I need to have a new table called maybe, protocols? (to store the said codes)
(if yes, the tble PROTOCOLS receive the id from TASKS? or TASKS receive the id from PROTOCOLS?)

I'm asking because I need all these codes to be unique, but not every task has this code... Some have and some do not have...

Can you help me with ideas to solve this? Or maybe tell me if I'm doing it all wrong...

Thank you
Diego

PS: I apologize for any gramatical mistakes... English isn't my main (or even second) language...
 
Hi.
Thanks for the tutorial
As I tought, I was doing it all wrong D:

I could have just used the own ID from tasks as a code to the said protocols...

Now I have only the table tasks, related with users and task_types... no need for another table to generate protocols, as Tasks generate a new code that can be used as protocol (duhhh, Yes, I'm feeling dumb as ever for thinking about doing a new table...)

Really apreciate your help.
Diego.
 
You're welcome. Glad to help.
 

Users who are viewing this thread

Back
Top Bottom