sql - create weak entity
848723Apr 14 2011 — edited Apr 14 2011Hi 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