The following setup will:
- Allow me to delete existing entries
- Prevent me from creating new entries in
products
这可能是因为条目是在<编码>产品代码>之前在<编码>上设定的。 但是,我不能在<条码>类别中编造条目。 在此之前,我知道该产品。
What would you do?
ALTER TABLE products
ADD CONSTRAINT FK_products
FOREIGN KEY (id) REFERENCES categories_products(product_id)
ON UPDATE CASCADE
ON DELETE CASCADE;
<>可见<>
categories:
id, name
categories_products:
category_id, product_id
products:
id, name
www.un.org/Depts/DGACM/index_spanish.htm 每个入境点的顺序为。
- Create an entry in categories
- Create an entry in product
- Using the IDs from 1. and 2. to create a relationship between
categories
andproducts