Hi, all.
I'm trying to understand a certain RI question.
I have 3 tables.
TABLE_A has a PK of A_1.
TABLE_B has a PK of B_1,A_1 (it's a composite key, with the second
field being a FK to TABLE_A).
TABLE_C is intended to have a value, such that it has RI to both
TABLE_A and TABLE_B.
TABLE_C would have a column of A_1, referencing TABLE_A, and two
columns which would be children to the composite primary key TABLE_B.
My question is - can I have a child value in TABLE_C, with relations
to both TABLE_A and TABLE_B, such that the value to be inserted in
TABLE_C.A_1 must exist in both TABLE_A and TABLE_B?
Strikes me that you can't do that... and that the RI from TABLE_C
should be to TABLE_B only - such that C would be a child to B, which
would be a child to A.
Any thoughts on that?
Thanks!
I'm trying to understand a certain RI question.
I have 3 tables.
TABLE_A has a PK of A_1.
TABLE_B has a PK of B_1,A_1 (it's a composite key, with the second
field being a FK to TABLE_A).
TABLE_C is intended to have a value, such that it has RI to both
TABLE_A and TABLE_B.
TABLE_C would have a column of A_1, referencing TABLE_A, and two
columns which would be children to the composite primary key TABLE_B.
My question is - can I have a child value in TABLE_C, with relations
to both TABLE_A and TABLE_B, such that the value to be inserted in
TABLE_C.A_1 must exist in both TABLE_A and TABLE_B?
Strikes me that you can't do that... and that the RI from TABLE_C
should be to TABLE_B only - such that C would be a child to B, which
would be a child to A.
Any thoughts on that?
Thanks!
Comment