K
kramer31
Hi. Suppose that I have a field table1.field1 that might sometimes be
null but when it has a value will be a value found in table2.field1.
Now table2.field1 is guaranteed to be unique and can't have null
values. Can table1.field1 be a foreign key constrained to
table2.field1? If so, is it good design?
Second question: Suppose I have a table table3 with fields field1,
field2, and field3 where field1 and field2 are together the primary
key (thus guaranteed to be unique in combination) and I have a table
table4 with fields field1 and field2 where field1 is the primary key,
is it possible to make table3.field1 a foreign key linking to the
primary key table4.field1? If so, is it there anything wrong with
doing this?
null but when it has a value will be a value found in table2.field1.
Now table2.field1 is guaranteed to be unique and can't have null
values. Can table1.field1 be a foreign key constrained to
table2.field1? If so, is it good design?
Second question: Suppose I have a table table3 with fields field1,
field2, and field3 where field1 and field2 are together the primary
key (thus guaranteed to be unique in combination) and I have a table
table4 with fields field1 and field2 where field1 is the primary key,
is it possible to make table3.field1 a foreign key linking to the
primary key table4.field1? If so, is it there anything wrong with
doing this?