can it make sense for one table to have multiple foreign keys?
Suppose I have three tables, Table A
, Table B
and Table C
. If I think of the tables as objects (and they are mapped to objects in my code), then both Tables A and B have a many to one relationship with Table C. I.e. Table/object A and B can each have many instances of C. So the way I designed it is that Table C
points to the primary key in both Table A
and Table B
: in other words, Table C
has 2 foreign keys (a_Id, and b_Id).
Edit: I forgot to mention also that Table A
can have many instances of Table B
. So Table B
has a foreign key into Table A. If this makes a difference...
I am wondering if this makes sense or is there a better way to do it? Thanks.