I got a problem when adding some foreign key constraints into the 2 tables OUTPUT and SUPERVISOR:
ALTER TABLE OUTPUT ADD CONSTRAINT PROJECT_OUTPUT_FK
FOREIGN KEY (proj_id)
REFERENCES PROJECT (proj_id)
NOT DEFERRABLE;
ALTER TABLE SUPERVISOR ADD CONSTRAINT PROJECT_SUPERVISOR_FK
FOREIGN KEY (proj_id)
REFERENCES PROJECT (proj_id)
NOT DEFERRABLE;
Errors showed:
SQL Error: ORA-02270: no matching unique or primary key for this column-list
02270. 00000 - "no matching unique or primary key for this column-list"
*Cause: A REFERENCES clause in a CREATE/ALTER TABLE statement
gives a column-list for which there is no matching unique or primary
key constraint in the referenced table.
*Action: Find the correct column names using the ALL_CONS_COLUMNS
catalog view
What should I do in this case?