insert - Foreign Key Constraint on child won't allow to update or add field to column -
insert - Foreign Key Constraint on child won't allow to update or add field to column -
trying insert next info in student_classes table.
receiving next error in mysql: 23:59:40 insert student_classes values (null,'1', '1', '2012-01-01', '90', '100', '80', '90', '3.0') error code: 1452. cannot add together or update kid row: foreign key constraint fails (cs362lgatesip1
.student_classes
, constraint fk_studentclasses_students
foreign key (studentid
) references students
(studentid
) on delete no action on update no action) 0.141 sec
studentid primary key in students table , foreign key in student_classes table both not null int(11). tried alter bit still maintain getting error. missing here? tried remove null still received error.
insert student_classes values (null,'1', '1', '2012-01-01', '90', '100', '80', '90', '3.0');
insert student_classes values (null,'1', '2', '2012-05-01', '60', '70', '80', '90', '2.70');
insert student_classes values (null,'1', '3', '2012-08-01', '100', '100', '100', '95', '4.0');
insert student_classes values (null,'2', '1', '2012-01-01', '85', '90', '80', '92', '3.5');
insert student_classes values (null, '2', '2', '2012-05-01', '70', '75', '80', '75', '3.0');
insert student_classes values (null, '2', '3', '2012-08-01', '60', '65', '70', '65', '2.5');
i don't think can insert null foreign key column of table.
insert mysql-workbench
Comments
Post a Comment