#1452 - Cannot add or update a child row

Good day,

I have created a MySQL database wuth the following tables and relationships:
http://www.libromania.cl/dsstgo/modelv7.jpg

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:
http://www.libromania.cl/dsstgo/dsstgo_lists.txt

And the classes table is:
http://www.libromania.cl/dsstgo/dsstgo_classes.txt

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?