REFERENCES
短语中编写目标列名。现在检查修改表格窗口中的所有信息,并在满意时单击“执行”。一般情况下:通过上下文菜单或按Ctrl+Alt+U。
如果您找到了这张图片,再往深处进入网站,您会找到这个页面: https://www.jetbrains.com/datagrip/features/other.html
这里有一个详细的解释如何操作。
CREATE TABLE product (
category INT NOT NULL, id INT NOT NULL,
price DECIMAL,
PRIMARY KEY(category, id)
);
CREATE TABLE customer (
id INT NOT NULL,
PRIMARY KEY (id)
);
CREATE TABLE product_order (
no INT NOT NULL AUTO_INCREMENT,
product_category INT NOT NULL,
product_id INT NOT NULL,
customer_id INT NOT NULL,
PRIMARY KEY(no),
INDEX (product_category, product_id),
INDEX (customer_id),
FOREIGN KEY (product_category, product_id)
REFERENCES product(category, id)
ON UPDATE CASCADE ON DELETE RESTRICT,
FOREIGN KEY (customer_id)
REFERENCES customer(id)
) ;