Resolved: Clarification on SQL Insert statement exercise 1
Hi Team, can you please help with this exercise. I get a error while trying to run the code below.
INSERT INTO titles
(
emp_no,
title,
from_date
)
VALUES
(
999903,
'Senior Engineer',
'1997-10-01'
); I get a 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 CACADE). Please help to clarify the issue.
(
emp_no,
title,
from_date
)
VALUES
(
999903,
'Senior Engineer',
'1997-10-01'
); I get a 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 CACADE). Please help to clarify the issue.
1 answers ( 0 marked as helpful)
Hi Guys,
I have rectified this issue. I missed to include the part of your lecture and just noticed and rectified it.
Please ignore my clarification.