Product table:
CREATE TABLE product (
model_no NUMBER NOT NULL,
manufacturer_no NUMBER,
product_desc VARCHAR2(12),
product_type VARCHAR(10),
unit_price NUMBER,
CONSTRAINT product_pk PRIMARY KEY(model_no)
);
product table is created successfully.
CREATE TABLE computer (
model_no NUMBER,
speed NUMBER,
memory NUMBER,
unit_price NUMBER,
CONSTRAINT fk_product
FOREIGN KEY (model_no)
REFERENCES product(model_no)
);
the foreign key is added successfully in one of the three tables::
In other tables when I try to add model_no foreign key using alter syntax
ALTER TABLE accessories
add CONSTRAINT fk_product
FOREIGN KEY(model_no)
REFERENCES product(model_no);
I get this error:
ORA-02264: name already used by an existing constraint