我有 3 张桌子:
create table book (book_id int not null primary key,
book_name char (100) unique)
create table author (author_id int not null primary key,
authorname char (100) unique)
create table bookauthor (book_id int,
author_id int,
CONSTRAINT pk_book_id PRIMARY KEY (book_id,author_id))
我想设置
- 列
book.book_id
作为 fk 到bookauthor.book_id
- 列
author.author_id
作为 fk 到bookauthor.author_id
请记住 pk inbookauthor
已打开book_id,author_id
。