Somewhat related to my previous question, this is regarding creation patterns to enforce table patterns where 'A' has many 'B' children where 'C' is the table of child 'B's for 'A', but has at least ONE.
Currently I have:
A (A_ID primary key, B_ID reference key)
B (B_ID primary key, etc)
C (A_ID reference, B_ID reference)
The point is that A definately always has at least ONE 'B' 'child', but optionally many more.. however the problem I have is that the 'C' table could currently reference the same 'B' that 'A' is already implicitely references..
example:
A
- Id: 1
- B_Id: 37
C
- A_Id: 1
- B_Id: 37
Whats the best way to constrain this? noting that 'A' could be updated to attempt to reference a 'B' that is already stated in the 'C' collection for that 'A', and more likely, 'C' references a 'B' that is already stated implicitely by the related 'A'..
Hope that makes sense, and again cheers in advance.
Edit: the tables are as follows:
'A' is a submission, a submission can have many 'contributors' (members), but always at least one. 'B' is a member 'C' is a table that links a 'A's to many 'B's