Skip to Main Content

SQL & PL/SQL

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!

sql - create weak entity

848723Apr 14 2011 — edited Apr 14 2011
Hi Expert team

I got the error message when create Registation table.
Error at line 7:ORA-02270: no matching unique or primary key for this column-list. I think it is because foreign key (RDate) is also from weak entity of Review as below. However, I don't know how to do in order to create Registration table.

CREATE Table REGISTRATION - weak entity
(
CustID Number (2),
RDate Varchar2(11),
Primary Key (CustID, RDate),
Foreign Key (CustID) REFERENCES CUSTOMER,
Foreign Key (RDate) REFERENCES REVIEW (RDate)
);



CREATE Table REVIEW - weak entity
(
RDate Varchar2(11),
ItemCode Varchar2(6),
CustID Number (2),
"Comment" Varchar2(30),
Primary Key (RDate, ItemCode, CustID),
Foreign Key (ItemCode) REFERENCES ITEM,
Foreign Key (CustID) REFERENCES CUSTOMER
);

Thanks
Mandy
This post has been answered by William Robertson on Apr 14 2011
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 12 2011
Added on Apr 14 2011
4 comments
5,751 views