freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

數(shù)據(jù)庫(kù)實(shí)驗(yàn)報(bào)告-閱讀頁

2024-08-24 08:23本頁面
  

【正文】 (score) as 最低成績(jī),avg(score) as 平均成績(jī) from score where o=39。 例322:(分組查詢) 求各門課程的平均成績(jī)與總成績(jī)。 例323:(分組查詢) 求各系、各班級(jí)的人數(shù)和平均年齡。 例324:(分組查詢) 輸入以下查詢語句并執(zhí)行,觀察出現(xiàn)的其結(jié)果并分析其原因。 Sname字段具有唯一性,不可疊加 例325:(分組查詢) 分析以下語句為什么會(huì)出現(xiàn)錯(cuò)誤。 SELECT SAGE FROM STUDENT GROUP BY SNO。 例327:(分組查詢) 求各系中除01班之外的各班的學(xué)生人數(shù)。0139。 例328:(自然連接查詢) 求學(xué)生學(xué)號(hào)、姓名以及其選修課程的課程號(hào)和成績(jī),但查詢結(jié)果中只能有一個(gè)SNO字段。 例329:(連接查詢) 求選修了課程001且成績(jī)?cè)?0分以下或成績(jī)?cè)?0分以上的學(xué)生的姓名、課程名稱和成績(jī)。00139。 例330:(連接查詢與表的別名) 求選修了課程的學(xué)生姓名、課程號(hào)和成績(jī)。 例331:(自身連接查詢) 求年齡大于 ’李麗’ 的所有學(xué)生的姓名、系和年齡。李麗39。 例332:(外部連接查詢) 求未選修了任何課程的學(xué)生的學(xué)號(hào)、姓名。 select sname,sdept from student where sage=(select sage from student where sname=39。)。select sno,sname from student where sno in(select sno from score where =(select o from course where ame=39。))。select sname,sdept from student where sageany (select sage from student where sdept=39。)。select sname,sdept from student where sageall(select sage from student where sdept=39。)。select sname,sdept from student where exists ( select * from score where o=39。)。 select sname,sdept from student where (sdept , sage )= (select sdept,sage from student where sname=39。)。select sname from student where not exists (select * from score where o=39。)。 select * from (select sno,sum(score) as 總成績(jī) from score group by sno order by sum(score) desc) where rownum6。[ 實(shí)驗(yàn)內(nèi)容 ]4. SQL視圖的定義與操縱: 例41: (建立視圖) 建立計(jì)算機(jī)系的學(xué)生的視圖STUDENT_CS。CS39。create view student_gr as select sno as 學(xué)號(hào),avg(score) as 平均成績(jī) from score group by sno。select * from student_cs where sage19。select 學(xué)號(hào),平均成績(jī) from student_gr where 平均成績(jī)88。insert into student_cs values(39。,39。,39。,39。,39。,19)。觀察其運(yùn)行結(jié)果并分析原因。對(duì)視圖的更新改變了基本表 例47: (視圖更新) 利用視圖STUDENT_GR,將平均成績(jī)?cè)黾?分。update student_gr set 平均成績(jī)=平均成績(jī)+2。delete from student_cs where sno=39。 例49: (視圖更新) 刪除視圖STUDENT_GR的全部數(shù)據(jù)。 例410:(刪除視圖) 刪除視圖STUDENT_CS和STUDENT_GR。drop view student_gr。create user user1 identified by user1。 例52: (授權(quán)) 給鄰近同學(xué)(用戶)授予Teach表上的所有權(quán)限。 例53: (授權(quán)) 給所有用戶授予Score表上的SELECT權(quán)限。 例54: (收回授權(quán)) 收回上面例子中的所有授予的權(quán)限。revoke select on score from public。6. SQL事務(wù)處理: 例61: (事務(wù)回退) 將Course表中的 ‘程序設(shè)計(jì)’ 課程學(xué)時(shí)數(shù)修改為80、 ‘編譯原理’ 課程學(xué)時(shí)數(shù)修改為70學(xué)時(shí),查詢?nèi)空n程的總學(xué)時(shí)數(shù)后,取消所有修改(ROLLBACK)。注意比較分析兩次查詢的結(jié)果。程序設(shè)計(jì)39。編譯原理39。rollback。 例62: (事務(wù)提交) 將Course表中的 ‘程序設(shè)計(jì)’ 課程學(xué)時(shí)數(shù)修改為80、 ‘編譯原理’ 課程學(xué)時(shí)數(shù)修改為70學(xué)時(shí),查詢?nèi)空n程的總學(xué)時(shí)數(shù)后,確認(rèn)所有修改(COMMIT)。注意比較分析兩次查詢的結(jié)果。程序設(shè)計(jì)39。編譯原理39。mit。實(shí)驗(yàn)四:存儲(chǔ)過程與觸發(fā)器[ 實(shí)驗(yàn)日期 ] 年 月 日[ 實(shí)驗(yàn)?zāi)康?]通過實(shí)驗(yàn)進(jìn)一步理解和掌握數(shù)據(jù)庫(kù)的存儲(chǔ)過程和觸發(fā)器。create unique index sc_grade on score(sno asc,score desc)。drop index sc_grade。alter table score add constraint fk_sno foreign key(sno) referencesstudent(sno) on delete cascade。alter table score drop constraint fk_sno。 create or replace procedure Student_Listasstu Student%rowtype。begin open CUR_VAR。exit when CUR_VAR%notfound。end loop。END。create or replace procedure Student_AvgasAvgGrade number(5,2)。begin open CUR_AVG。exit when CUR_AVG%notfound。end loop。END。create or replace procedure Student_Listasstu Student%rowtype。begin open CUR_VAR。exit when CUR_VAR%notfound。end loop。例84: (觸發(fā)器) 創(chuàng)建滿足下列要求的觸發(fā)器,對(duì)Student、Score和Course表進(jìn)行模仿參照完整性關(guān)系的維護(hù)。end if。(2) 在Score上創(chuàng)建一個(gè)插入觸發(fā)器TR_Score_insert,當(dāng)在Score表中插入一條記錄時(shí),要檢查其學(xué)號(hào)在Student表和課程號(hào)在Course表中是否存在,若不存在則不允許插入; create or replace trigger TR_Score_insert before insert ON scorereferencing old as new old as old for each rowdeclarepsno %type。beginselect sno into psno from student where sno=:。if(psno is null and po is null)thenrollback。end。 create or replace trigger TR_Course_Upd after update on COURSEreferencing new as new old as old for each rowbeginif updating thenupdate SCORE set o=: where o=:。e
點(diǎn)擊復(fù)制文檔內(nèi)容
環(huán)評(píng)公示相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1