#1452 - Cannot add or update a child row

Good day,

I have created a MySQL database wuth the following tables and relationships:

Using “load data local infile” instructions, I have loaded data in Schools, Classes and Books.
When try to do it for Lists table, the following error message is generated:

#1452 - Cannot add or update a child row: a foreign key constraint fails (libroman_2012.Lists, CONSTRAINT Lists_ibfk_1 FOREIGN KEY (ClassID) REFERENCES Classes (ClassID))

Any help would be very appreciated.

Thanks a lot.

the message means that one of the rows you’re loading into the lists table has a value in the ClassID column that isn’t in the classes table

Hi r937,

Here is the file I intended to load into Lists table:

And the classes table is:

I see there is classes with identifiers from i to 73 in both files.

Thanks a lot!!!

how do i know which columns are supposed to reference which columns?