我正在为我的学校做一个数据库项目,我偶然发现了这个我似乎无法解决的奇怪问题。这是我尝试创建表时的代码:
Create table Offering(
StartDate DATE NOT NULL ,
PRIMARY KEY(StartDate)
);
Create table OfferPerWeek(
StartDate DATE NOT NULL ,
StartTime TIME(0) NOT NULL ,
[Day] VARCHAR(10) NOT NULL
PRIMARY KEY (StartDate,[Day],StartTime)
FOREIGN KEY (StartDate)
REFERENCES Offering(StartDate)
);
--The table that have the issues
Create table OfferPerWeek_Venue(
[Day] VARCHAR(10) NOT NULL ,
StartDate DATE NOT NULL ,
StartTime TIME(0) NOT NULL
PRIMARY KEY (StartDate, [Day], StartTime)
FOREIGN KEY (StartDate, [Day], StartTime)
REFERENCES OfferPerWeek (StartDate, [Day] , StartTime)
);
Run Code Online (Sandbox Code Playgroud)
错误消息说:
在列级 …