Getting error while inserting new record
in
The Complete Data Visualization Course with Python, R, Tableau, and Excel
/
Regression Plot - Introduction - General Theory and Dataset
insert into titles ( emp_no, title, from_date ) values ( 999903, 'Senior Engineer', '1997-10-01' ) Error Code: 1452. Cannot add or update a child row: a foreign key constraint fails (`employees`.`titles`, CONSTRAINT `titles_ibfk_1` FOREIGN KEY (`emp_no`) REFERENCES `employees` (`emp_no`) ON DELETE CASCADE) 0.000 sec
2 answers ( 0 marked as helpful)
Hello Mohammad,
I had the same error pop up, I hope someone is able to answer your question soon.
Were you able to solve it though?
Hi Bibire,
Yes, I did by using the syntax mentioned below.
insert into titles (emp_no, title, from_date, to_date)
values ('99903', 'Senior Engineer', '1997-01-01', '9999-01-01');