I'm having a headache over this error:
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"
Someone save me from this agony and tell me what's wrong with my code.
Code:
CREATE TABLE Concert
( CDate DATE NOT NULL,
StartTime TIMESTAMP NOT NULL,
VHall VARCHAR2(20) NOT NULL,
FinnishTime TIMESTAMP NOT NULL,
OName VARCHAR2(15) NOT NULL,
OFee DECIMAL(19,4) NOT NULL,
PRIMARY KEY (CDate, StartTime, VHall),
FOREIGN KEY (VHall) REFERENCES Venue(VHall),
FOREIGN KEY (OName) REFERENCES Orchestra(OName) ) ;
Code:
CREATE TABLE ConcertStandin
( CDate DATE NOT NULL,
StartTime TIMESTAMP NOT NULL,
VHall VARCHAR2(20) NOT NULL,
MNo VARCHAR2(15) NOT NULL,
StandinFee DECIMAL(19,4) NOT NULL,
PRIMARY KEY (CDate, StartTime, VHall, MNo),
FOREIGN KEY (CDate) REFERENCES Concert(CDate),
FOREIGN KEY (StartTime) REFERENCES Concert(StartTime),
FOREIGN KEY (VHall) REFERENCES Venue(VHall),
FOREIGN KEY (MNo) REFERENCES Musician(MNo) ) ;
Thanks in advance.