22,210
社区成员
发帖
与我相关
我的任务
分享
create trigger tr_IntroduceYourself_delete on IntroduceYourself
for delete
as
delete Education where cStudentsId in(select cStudentsId from deleted)
delete ApplyJobInformation where cStudentsId in(select cStudentsId from deleted)
CREATE TABLE IntroduceYourself(
cStudentsId char(10) NOT NULL,
vSelfAssessment varchar(100) NOT NULL,
vSelfSpecialty varchar(100) NULL,
vHobbiesInterest varchar(100) NULL
)
ALTER TABLE IntroduceYourself
ADD CONSTRAINT fkIntroduceYourself FOREIGN KEY (cStudentsId) REFERENCES Students(cStudentsId)
--创建学生教育经历(Education)表
CREATE TABLE Education(
cStudentsId char(10) NOT NULL,
vEducationUndergo varchar(100) NOT NULL,
vTrainUndergo varchar(100) NULL
)
ALTER TABLE Education
ADD CONSTRAINT fkEducation FOREIGN KEY (cStudentsId) REFERENCES Students(cStudentsId) on delete cascade
--创建学生求职信息(ApplyJobInformation)表
CREATE TABLE ApplyJobInformation(
vExpectWorkPlace varchar(30) NULL,
vIndustry varchar(70) NOT NULL,
cPosition char(50) NOT NULL,
dApplyTime datetime NOT NULL,
cStudentsId char(10) NOT NULL
)
ALTER TABLE ApplyJobInformation
ADD CONSTRAINT fkApplyJobInformation FOREIGN KEY (cStudentsId) REFERENCES Students(cStudentsId) on delete cascade