?????????????
???????????? ???????[ 2014/5/4 10:25:45 ] ?????????????????
????--?????????
select sum(credit) '???'
from courses
where courseid in(
select courseid
from scts
where studentid='200520701201'
)
insert into Scts(courseid??studentid??teacherid)
values ('50103Q0'??'200520701201'??'080102');
select *from courses where courseid='10042B0'
|
????--3.???DML???????????????“??”??COURSES.character?????????Ρ?????????????????γ????и?γ??????????????????????????“??????????Σ?”??????????
Create trigger Tri_INSERT_SCTS
on SCTS
after insert
AS
BEGIN
DECLARE @stype varchar(10);
DECLARE @collegeid varchar(5);
if exists(select * from courses AS C
where C.courseid in(select courseid from inserted ) and C.Character like '??%')
BEGIN
select @collegeid=college from courses AS C
where C.courseid in(select courseid from inserted )
if exists (select college from students AS S
where S.studentid in(select studentid from inserted )and S.college=@collegeid)
PRINT '????γ??'
else
BEGIN
Rollback Transaction
PRINT '??????????Σ?'
END
END
ELSE
PRINT '?????????γ??'
END
|
????--??????????
????insert into Scts(courseid??studentid??teacherid)
????values ('20224B0'??'200520805403'??'080102');
????--?????????? ???
????insert into Scts(courseid??studentid??teacherid)
????values ('10019B5'??'200520805403'??'080102');
????--??????????
insert into Scts(courseid??studentid??teacherid)
values ('50095Q0'??'200520805403'??'080102');
select *from students where college='08'
select *from colleges where collegeid='08'
select *from courses where courseid in (select courseid from courses where character not like '??%')and college
='08'
select *from scts where studentid='200520805403'
delete from scts where courseid='20224B0' and studentid='200520805403';
|
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11