• A foreign key constraint requires that the value exist in the foreign table, so adding two foreign key constraints means that the value you add to T3 must exist in both T1 and T2. There is no way to use foreign key constraints to require that the value exist in either T1 or T2.

    Although it is more complex than a constraint, I think the only way you will achieve the either/or solution you are looking for is with a DML trigger. In a trigger you can use subqueries to check both tables for the value to be added to T3 and only allow the insert to complete if a match is found in either one. I'm not familiar enough with the trigger syntax to give you a complete statement, but I do believe you need to look in the direction of triggers to find the solution to your problem.