create table BookChe (
check number(10) not null,
bookISBN number(13) not null,
bookCopy number(10) not null,
constraint pk_ResChe primary key (check, bookISBN, bookCopy),
constraint fk_ResChe_Che foreign key (check) references checkout,
constraint fk_ResChe_book foreign key (bookISBN, bookCopy) references book
);
uj5u.com熱心網友回復:
check
是保留字。不要在沒有雙引號的情況下使用它。例如,如果我們將其更改為check_col
,它可以正常作業:
create table BookChe (
check_col number(10) not null,
bookISBN number(13) not null,
bookCopy number(10) not null,
constraint pk_ResChe primary key (check, bookISBN, bookCopy),
constraint fk_ResChe_Che foreign key (check) references checkout,
constraint fk_ResChe_book foreign key (bookISBN, bookCopy) references book
);
和雙引號的例子:
create table BookChe (
"CHECK" number(10) not null,
bookISBN number(13) not null,
bookCopy number(10) not null,
constraint pk_ResChe primary key ("CHECK", bookISBN, bookCopy),
constraint fk_ResChe_Che foreign key ("CHECK") references checkout,
constraint fk_ResChe_book foreign key (bookISBN, bookCopy) references book
);
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/506865.html