I'm new here. I have two tables that are not related to each other, but both need a third one. Let me explain with an example ...
TablaUsuarios (idUsuario, nombre, apellido)
TablaEmpresas (idempresa, nombre_e, rif)
For both tables I need to register mails; a user can have several emails ( 1: M ), and also a company ( 1: M ), so by normalization I separated this information into a table called Email that I structured in the following way
TablaEmail(idcorreo, direccion, propietario, idpropietario)
With the owner and owner-id columns as a single key, where the record was supposed to be as follows:
TablaUsuarios TablaEmpresas
idusuario | nombre | apellido idempresa | nombre_e | rif
1 | María | sosa 1 | Empresa1 |123
TablaEmail
idemail | direccion | propietario |idpropietario
1 | [email protected] | TablaUsuarios | 1
2 | [email protected] | TablaEmpresas | 1
But when making a record of any of the tables requires me to make a record in both (Users-Companies) which should not be a rule, because they do not have any relationship between them.
If someone could help me, I would appreciate it. Greetings ..