I have the following tables:
Where cadastro
contains the primary key id_cadastro
that
the lotes
refers to it.
However, the bank was not normalized, so the foreign key that refers to id_cadastro
does not exist.
I'm doing the registration manually, but it's almost impossible to find any references that do not exist.
Is there any way that I can automatically search for non-existent references with SQL commands?