🛠️ Scheduled Maintenance | We’ll be undergoing scheduled maintenance and upgrades between 00:00 PST Jan 26th until 00:00 PST Jan 28th. There may be brief interruption of services in that period. We apologize for the inconvenience.

×
The 365 Data Science team is proud to invite you to our own community forum. A very well built system to support your queries, questions and give the chance to show your knowledge and help others in their path of becoming Data Science specialists.
Ask
Anybody can ask a question
Answer
Anybody can answer
Vote
The best answers are voted up and moderated by our team

Getting error in Mysql when trying to insert values

Getting error in Mysql when trying to insert values

0
Votes
1
Answer

19:15:41 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
How to solve this error?

1 Answer

365 Team
0
Votes

Hi Tripti!
Thanks for reaching out.
Please refer to the following thread for an explanation. Thank you.
https://365datascience.com/question/error-code-1452-cannot-add-or-update-a-child-row-insert-statement-exercise/
Hope this helps.
Best,
Martin