Here is the statement I am executing and related error, any hints what is wrong and how to debug further is appreciated. Using MySQL Workbench/MySQL.
Especially confused what means child row here? How foreign key related to child row? And what is the child row here?
ALTER TABLE Orders
ADD CONSTRAINT fk_Customer FOREIGN KEY (CustomerID)
REFERENCES Customers(CustomerID)
Error Code: 1452. Cannot add or update a child row: a foreign key constraint fails (
test.#sql-ff_2, CONSTRAINTfk_CustomerFOREIGN KEY (CustomerID) REFERENCESCustomers(CustomerID))