
ALTER TABLE strcou
ADD CONSTRAINT fk_strcou_学团盯号 FOREIGN KEY(学号) REFERENCES student(学号)
ALTER TABLE StuCou
ADD CONSTRAINT fk_StuCou_课程编号 FOREIGN KEY(课程编号) REFERENCES Department(课程编号)
ALTER TABLE Course
ADD CONSTRAINT fk_Course_课程编号 FOREIGN KEY(课程编号) REFERENCES Department(课程编号)
ALTER TABLE class
ADD CONSTRAINT fk_Class_系部编号 FOREIGN KEY(系部编号) REFERENCES Department(系部编塌孙和号)
ALTER TABLE student
ADD CONSTRAINT fk_student_班级编号 FOREIGN KEY(班级编号) REFERENCES class(班级编凯码号)
alter table student add constraint FK_student_classid foreign key(classid) references class(classid)
alter table stuGou add constraint FK_stuGou_stuId foreign key(stuId) references student(stuId)
alter table stuGou add constraint FK_stuGou_DepartmentId foreign key(DepartmentId) references Department(DepartmentId)
alter table class add constraint FK_class_DepartmentId foreign key(DepartmentId) references Department(DepartmentId)