【正文】
e 39。 when 0 then 39。 end(3)use jxgldeclare mycursor4 scroll cursorfor select * from 學(xué)生open mycursor4 select cursor_rows, case cursor_rows when 1 then 39。 else 39。 set n=n+1 endgoexec nacrissus2.use jxglgocreate proc class_infobjbh char(6)=39。asselect count(*) as 人數(shù) from 選修 where 課程號(hào)=kch group by 課程號(hào)goexec proc_num 39。asselect 課程號(hào), count(*) as 人數(shù) from 選修 group by 課程號(hào) having 課程號(hào)=kch goexec pro_num_選修1 39。,10,1) rollback transactionendgoinsert into 學(xué)生(學(xué)號(hào),姓名,性別,出生日期)values(39。,39。)5.create trigger tri_選修on 選修for update,insertasdeclare score int,courseid char(2),stuid char(8)select score =成績,courseid=課程號(hào),stuid=學(xué)號(hào) from insertedif score60 update 選修 set 備注=39。,39。else begin print 39。7.create trigger [checkid] on 選修 instead of insert as if not exists(select * from 學(xué)生where 學(xué)號(hào)=(select 學(xué)號(hào)from inserted)) print 39。 end 習(xí)題十一、填空題 B 二、選擇題 8 backup database database 10 sp_addumpdevice 三、實(shí)踐題1.習(xí)題十一一、填空題15CCCCB 610DBCAB 1115 D B A D D二、選擇題 4. 登錄 5. windows模式 7. dbo 8. 登錄賬戶 9. guest 10. dbo三、實(shí)踐題1.use mastergosp_addlogin stu_login12.sp_addlogin stu_login2,’123’,’pubs’3.(1)alter login sa enable 部分機(jī)器需要這個(gè)代碼啟用sa登錄名(2)初始界面(圖1)斷開連接(圖2)連接對(duì)象資源管理器(圖3)連接服務(wù)器(圖4)sa成功登陸界面((圖5)(3)輸入如下代碼use pubsgosp_grantdbaccess 39。gosp_grantdbaccess 39。4.use pubsgocreate role myrolegosp_addrolemember 39。5.(1)use pubsgogrant create table to stu_login1_u(2)use pubsgogrant select,insert,update,delete on 圖書to stu_login1_u(3)use pubsgogrant select on 圖書(圖書編號(hào),定價(jià),出版日期) to myrole with grant optiongrant select on 圖書(圖書編號(hào),定價(jià),出版日期) to stu_login1_u,stu_login2_u with grant option(4)select * from 圖書 無法查詢select 圖書編號(hào),定價(jià),出版日期from 圖書 能查詢注意:驗(yàn)證需在登錄名stu_login1狀態(tài)下習(xí)題十二一、填空題 B C C C二、選擇題 4. 登錄 5. windows模式 7. dbo 8. 登錄賬戶 9. guest 10. dbo