use database_demo go create table student_new ( Departmentid int not null, Specialityid int not null, name nchar(10) not null,Sex bit not null, constraint PK_student_new PRIMARY KEY (Departmentid,Specialityid,Classid,ClassInid) ) use dabase_demo go create table prize_student_new( PrizeId int not null, NumberOfMoney int not null, Descripition nchar(10) not null, Departmentid int not null, Speciality int not null, Classid int not null, ClassInid int not null, constraint PK_prize_student_new primary key (PrizeId) ) go alter table prize_student_new add constraint FK_student_new_prize_student_new foregin key (Departmentid,Specialityid,Classid,ClassInid) references student_new(Departmentid,Specialityid,Classid,ClassInid)
来自搜搜问问 |