110,566
社区成员
发帖
与我相关
我的任务
分享
create table book_Type
(
book_id int identity(1,1),
book_Type nvarchar(20),
primary key(book_id,book_Type)
)
create table book
(
book_ip int identity(1,1) primary key,
book_name nvarchar(20),
book_author nvarchar(20),
book_publisher nvarchar(20),
book_id int,
book_Type nvarchar(20),
foreign key (book_id,book_Type) references book_Type(book_id,book_Type)
)
create table book_Type
(
book_id int identity(1,1),
book_Type nvarchar(20),
primary key(book_id)
)
create table book
(
book_ip int identity(1,1) primary key,
book_name nvarchar(20),
book_author nvarchar(20),
book_publisher nvarchar(20),
book_id int,
foreign key (book_id) references book_Type(book_id)
)
按照这样做就好了