#1452 - Cannot add or update a child row: a foreign key constraint fails (`dbs997373`.`#sql-44a2_3f1cd`, CONSTRAINT `#sql-44a2_3f1cd_ibfk_1` FOREIGN KEY (`categories_id`) REFERENCES `categories` (`categories_id`)) code example
Example: create table mysql with foreign key
CREATE TABLE Orders (
OrderID int NOT NULL,
OrderNumber int NOT NULL,
PersonID int,
PRIMARY KEY (OrderID),
FOREIGN KEY (PersonID) REFERENCES Persons(PersonID)
);