Thank you very much for your answer, David.
If I add the wbs_name field to the products table, it will only defer the issue to now check if the wbs_name is the wbs_name assigned to the project. The constraint you propose could check if the wbs_name and wbs_code combination exist, but it may allow the case where they belong to another project, when for example, copying a product from another project.
I would like the database model to take into account that, but I do not find a way. As I said before, my option would be for an update or insert trigger to check the projects table, find out the wbs_name and check that the product wbs_code belongs to it.
Or maybe another idea I do not see now.
Regards,
Simon Graffe

