I have requirement for a web app that states that a user should be able to either upload an instruction document(s) (.pdf, .doc, .txt) or provide text for the instructions. The
Something feels a bit off here
There is no UserID
in this schema, so it should be added to the
Instruction
table.
If a user does not upload anything, there will (should) be no entry
for that user in the Instruction
table.
So the problem -- as stated -- is not about placing constraints on these three tables.
When loading this structure, use a stored procedure and/or a transaction -- to make sure that at least one of the child record gets populated. Though, this has nothing to do with the business requirement that user has to upload something.