此代码有什么问题?
CREATE TABLE pharmacy_night
(
[Id_day] INT NOT NULL ,
[Id_pharmacy] INT,
constraint pk_pharmacy_night primary key (Id_day, Id_pharmacy),
constraint fk_pharmacy_night_days foreign key (Id_day) references days(Id_day),
constraint fk_pharmacy_night_pharmacy foreign key (Id_pharmacy) references pharmacy (Id_pharmacy)
)
答案 0 :(得分:1)
尝试使用复合键
create table abc (
ID int,
number int,
constraint PK_abc primary key (ID, number)
);
尝试使用主键
create table abc
(
ID int primary key,
number int
)