I have some pretty complex data that I have organised in a table with columns similar to below:
|| id_1 || id_2 || id_3 || id_4 || quantity ||
id_1 and id_2 will always be NON-NULL, but at least one of id_3 and id_4 will be NULL, deciding which other table to join to. Is it possible to have a composite primary key of id's 1-4 knowing that at least one of them will be NULL? Or is this a poor design for a table?