Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Can we create UNIQUE FK constraint without unique INDEX?

SebaVastaNov 8 2023 — edited Nov 8 2023

Can we create a unique foreign key constraint on a child-table without having to create a unique index also?

Our DB is a 11g Enterprise Edition Release 11.2.0.4.0 .

I.e. like ALTER TABLE products ADD CONSTRAINT fk_supplier UNIQUE FOREIGN KEY (supplier_id) REFERENCES supplier(supplier_id);

So in our products child-table, the foreign key is unique. I.e. a supplier can supply only ONE product in our unique/unusual setup.

This post has been answered by L. Fernigrini on Nov 8 2023
Jump to Answer
Comments
Post Details
Added on Nov 8 2023
7 comments
127 views