Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Post History
I have tables A and B and then I have a many to many join table with foreign keys to both called a_b. Neither foreign key can be null and the combinations for the foreign keys to A and B are unique...
#1: Initial revision
Is it possible in MySQL to require each row in a table have at least one foreign key record in a join table?
I have tables A and B and then I have a many to many join table with foreign keys to both called a_b. Neither foreign key can be null and the combinations for the foreign keys to A and B are unique. In the business logic for the program, every record in the A table must have a relationship to at least one record in the B table. Is it possible to enforce that constraint at the database level? I don't think it is, but thought I would ask.