I have one "sub-table" (C) and two "super-table" (A, B):
- A (id PRIMARY KEY)
- B (id PRIMARY KEY)
- C (id1 , id2, c_col)
To make multiple inheritance, I can easily state that C.id1 refers to A.id and C.id2 to B.id by creating FOREIGN KEYs. However, owing to my model (actually because A and B are also inheritance of an other super-table), id1 and id2 will always have the same value for one occurence. My question is, do you think I need to create an additionnal "id" column in the C table as PRIMARY KEY in addition to "id1" and "id2" forein key ? More easily, can I just arbitrary pick id1 or id2 column and define it as PRIMARY KEY ?
I don't know if I'm very clear. If not, please tell me how you usually modelize multiple inheritance in SQL.