Relation design errors

I thought I should connect with drag and drop all of the fields that are the same. One of them worked. The other ones I tried are giving me the error: integrity constraint violation: foreign key no parent; … in the screenshot I’m trying to connect latin name. The database can be downloaded here:
https://www.dropbox.com/scl/fo/u3t2s09hxq0zgu815gwho/ABTXmnE7TvCaaz47NSSUNME?rlkey=i69zpn2axp9otqshasiuck6ji&st=06pxf2qt&dl=0

I would suspect that the message tells you: “you are trying to create a foreign key; but the table already has some data, and one of the records has the foreign key value that isn’t found in the parent table”.

1 Like

Same as mike wrote, but for your case:
You are not allowed to have images for species, wich are not included in the table “species” and this includes possibe typos.
.
You may check for missing species with a left join of “images” and “species” on “images”.“latin_name” = “species”.“Latin_name”

1 Like

.Promising thank you. :smiley:
I made a query with the gui.

SELECT “images”.“latin_name”, “species”.“Latin_name” FROM { oj “images” LEFT OUTER JOIN “species” ON “images”.“latin_name” = “species”.“Latin_name” }

the result showed an entry in images that does not exist in species. THanks again!

1 Like

The SQL code in the message box is the code that fails, because it tries to constitute a rule that would be violated right from the start.