0

我已经看到了许多关于如何解决此问题的示例“确保外键与主键的值匹配”。但它仍然不能解决我的问题

CREATE TABLE `order table`(
OrderId INT PRIMARY KEY NOT NULL,
`Product one` VARCHAR(60),
`Product two` VARCHAR(60),
`Product three` VARCHAR(60),
CustomerId INT NOT NULL,
FOREIGN KEY (CustomerId) REFERENCES customers(CustomerId)
);

INSERT INTO `new_schema`.`order table`(
OrderId, `Product one`, `Product two`, `Product three`, CustomerId)
VALUES ('0', 'Ryzen 7 3700xt',' Power Supply', 'Stuff', 0);

是的,在我的客户表中,有一个 int 为 0 的客户 ID,就我而言,没有拼写错误

4

0 回答 0