i want to create these two tables but i’m getting an error which says SECTION keys that being referenced by foreign keys of HOLD are not primary key. as it’s seen in the query they are primary keys. how can i solve this problem?
create table SECTION(
ID integer foreign key references TERM(ID),
CID integer foreign key references COURSE(CID),
SECT integer,
constraint PK_SECTION primary key (ID,CID,SECT),
);
create table HOLD(
NAME varchar(30) foreign key references INSTRUCTOR(NAME),
ID integer foreign key references SECTION(ID),
CID integer foreign key references SECTION(CID),
SECT integer foreign key references SECTION(SECT),
constraint PK_HOLD primary key (NAME,ID,CID,SECT),
);
ID,CID,SECT are not primary keys, they all together are one primary key (of multiple attributes). You have to reference them as one like this: