Home > database > Rookie question, SQL will know will be the sample import problems
Rookie question, SQL will know will be the sample import problems
Time:10-01
Good bosses, I 0 based learning SQL, bought a SQL will be will be, the import of the book with the MySQL example, a total of two TXT, the first is "create" can copy and paste and perform the success, the second TXT "populate" copy and paste into executed after failure, next is how to return a responsibility excuse me, thank you very much Error: "09:09:11 INSERT INTO OrderItems (order_num, order_item prod_id, quantity, item_price) VALUES (20009, 3, 'BNBG03', 250, 2.49) the Error Code: 1452. Always add or update a child row: a foreign key constraint fails (` test `. ` OrderItems `, constraint ` FK_OrderItems_Orders ` foreign key (` order_num `) REFERENCES ` orders ` (` order_num `)) 0.031 SEC "
CodePudding user response:
The create table with foreign key The role of the foreign key is inserted into the data of a column must be the value of another table