parfaitmacaron — 2013-04-14T11:33:29-04:00 — #1
If I have 6 fields in a table, where one of them is the id of "x" table so that it becomes the primary key e.g. "x_id" and then have a, b, c, d fields which are also id fields (a_id, b_id, c_id, d_id) to form a composite key, is this ok?
And the next question is how would I code up the MySQL?
Is it allowed to join a composite key field e.g. "a_id" (foreign key) in the child table to the primary key "a_id" of the parent table in a one-to-many relationship?
kylewolfe — 2013-04-15T19:28:27-04:00 — #2
May I ask the relationship you plan on implementing? 6 keys seems to me like theres something a little excessive going on
parfaitmacaron — 2013-04-16T09:00:35-04:00 — #3
It's a one-to-many relationship. There's only 4 keys now.
kylewolfe — 2013-04-16T09:22:39-04:00 — #4
Well you see what I mean? You're down to 4 rather than 6. Can you explain the relationship? Column names and what they are / mean?