![數(shù)據(jù)庫原理答案西安電子科技大學教學文案_第1頁](http://file4.renrendoc.com/view/5b3978aeeb36d13ecea6bfbb23665180/5b3978aeeb36d13ecea6bfbb236651801.gif)
![數(shù)據(jù)庫原理答案西安電子科技大學教學文案_第2頁](http://file4.renrendoc.com/view/5b3978aeeb36d13ecea6bfbb23665180/5b3978aeeb36d13ecea6bfbb236651802.gif)
![數(shù)據(jù)庫原理答案西安電子科技大學教學文案_第3頁](http://file4.renrendoc.com/view/5b3978aeeb36d13ecea6bfbb23665180/5b3978aeeb36d13ecea6bfbb236651803.gif)
![數(shù)據(jù)庫原理答案西安電子科技大學教學文案_第4頁](http://file4.renrendoc.com/view/5b3978aeeb36d13ecea6bfbb23665180/5b3978aeeb36d13ecea6bfbb236651804.gif)
![數(shù)據(jù)庫原理答案西安電子科技大學教學文案_第5頁](http://file4.renrendoc.com/view/5b3978aeeb36d13ecea6bfbb23665180/5b3978aeeb36d13ecea6bfbb236651805.gif)
版權說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權,請進行舉報或認領
文檔簡介
數(shù)據(jù)庫原理答案西安電子科技大學精品文檔數(shù)據(jù)庫原理-西安電子科技大學出版社姓名:陳俊昌班級:10923337杭州電子科技大學計算機學院111)給學生表增加一屬性 Nation(民族),數(shù)據(jù)類型為varchar(20)altertableStudentaddnationvarchar(20)2)刪除學生表中新增的屬性 nationaltertableStudentdropcolumnnation3)向成績表中插入記錄(“2001110”,3“”,80)insertintoGrade(Sno,Cno,Gmark)values('2001110','3',80)4)將學號為“2001110”的學生成績修改為70分updateGradesetGmark=70whereSno='2001110'5)刪除學號為“2001110”的學生成績記錄deletefromGradewhereSno='2001110'6)在學生表的clno屬性上創(chuàng)建一個名為 ix_class的索引,以班級號的升序排序createindexix_class收集于網(wǎng)絡,如有侵權請聯(lián)系管理員刪除精品文檔onstudent(clno)7)刪除ix_class索引dropindexstudent.ix_class12.1)找出所有被學生選修了的課程號selectdistinctCno課程號fromGrade2)找出01312班女生的個人信息select*fromStudentwhereClno='01311'andSsex='女'3)找出01311班和01312班的學生姓名性別出生年份selectsname學生姓名,ssex性別,2011-sage出生年份fromStudentwhereClno='01311'orClno='01312'4)找出所有姓李的學生的個人信息select*fromStudentwhereSnamelike李'%'5)找出李勇所在班級的學生人數(shù)selectCOUNT(*)fromStudentwhereClnoin(selectClnofromStudentwhereSname='李勇')收集于網(wǎng)絡,如有侵權請聯(lián)系管理員刪除精品文檔6)找出課程名為操作系統(tǒng)的平均成績 最高分最低分selectAVG(Gmark)平均成績,MAX(Gmark)最高分,MIN(Gmark)最低分fromGradewhereCnoin(selectCnofromCoursewhereCname='操作系統(tǒng)')7)選修了課程的學生人數(shù) ;selectCOUNT(distinctsno)學生人數(shù)fromGrade8)選修了操作系統(tǒng)的學生人數(shù) ;selectCOUNT(distinctsno)學生人數(shù)fromGradewhereCnoin(selectCnofromCoursewhereCname='操作系統(tǒng)')9)找出2000級計算機軟件班的成績?yōu)榭盏膶W生姓名selectSname學生姓名from(select*fromStudentwhereClnoin(selectClnofromClasswhereSpeciality='計算機軟件'andInyear='2000'))ruanjianwhereruanjian.Snonotin(selectdistinctSnofromGrade)withruanjianas收集于網(wǎng)絡,如有侵權請聯(lián)系管理員刪除精品文檔(selectSno,SnamefromStudentjoinClassonStudent.Clno=Class.ClnowhereClass.Speciality='計算機軟件'andClass.Inyear='2000')selectSname學生姓名fromruanjianwherenotexists(select*fromGradewhereruanjian.Sno=Grade.Sno)13.1)找出和李勇在同一個班級的學生信息select*fromStudentwhereSname<>'李勇'andClnoin(selectClnofromStudentwhereSname='李勇')2)找出所有與學生李勇有相同選修課程的學生信息select*fromStudentwhereSname<>'李勇'andexists(select*fromGradewhereStudent.Sno=Grade.SnoandGrade.Cnoin(selectCnofromGradewhereSnoin(selectSnofromStudentwhereSname='李勇')))3)找出年齡介于學生李勇和 25歲之間的學生信息select*fromStudentwhereSage<25andSage>(selectSagefromStudentwhereSname='李勇')4)找出選修了課程是操作系統(tǒng)的學生學號和姓名收集于網(wǎng)絡,如有侵權請聯(lián)系管理員刪除精品文檔selectSno學號,Sname姓名fromStudentwhereexists(select*fromGradewhereCnoin(selectCnofromCoursewhereCname='操作系統(tǒng)')andStudent.Sno=Grade.Sno)5)找出沒有選修 1號課程的所有學生姓名selectSname姓名fromStudentwherenotexists(select*fromGradewhereStudent.Sno=Grade.SnoandCno=1)6)找出選修了全部課程的學生姓名selectSname姓名fromStudentwherenotexists(selectCnofromCourseexceptselectCnofromGradewhereStudent.Sno=Grade.Sno)14.1)查詢選修了3號課程的學生學號及成績 ,并按成績的降序排列selectSno學號,Gmark成績fromGradewhereCno=3orderbyGmarkdesc2)查詢?nèi)w學生信息,要求查詢結果按班級號升序排列 ,同一班級學生按年齡降序排列select*fromStudent收集于網(wǎng)絡,如有侵權請聯(lián)系管理員刪除精品文檔orderbyClnoasc,Sagedesc3)求每個課程號及相應的選課人數(shù)selectGrade.Cno課程號,COUNT(Grade.Cno)選課人數(shù)fromGradejoinCourseonGrade.Cno=Course.CnogroupbyGrade.Cno4)查詢選修了3門以上課程的學生學號selectSno學號fromGradegroupbySnohavingCOUNT(Sno)>315.1)將01311班的全體學生的成績置零updateGradesetGmark=0whereSnoin(selectSnofromStudentwhereClno='01311')2)刪除2001級計算機軟件的全體學生的選課記錄deletefromGradewhereSnoin(selectSnofromStudentwhereClnoin(selectClnofromClasswhereSpeciality='計算機軟件'andInyear='2001'))3)學生李勇已退學,從數(shù)據(jù)庫中刪除有關他的記錄deletefromGradewhereSnoin(selectSnofromStudent收集于網(wǎng)絡,如有侵權請聯(lián)系管理員刪除精品文檔whereSname='李勇')updateClasssetNumber=Number-1whereClnoin(selectClnofromStudentwhereSname='李勇')updateClasssetMonitor=casewhenMonitor=(selectSnofromStudentwhereSname='李勇')then''endfromClasswhereClnoin(selectClnofromStudentwhereSname='李勇')deletefromStudentwhereSname='李勇'4)對每個班,求學生的平均年齡,并把結果存入數(shù)據(jù)庫altertableClassaddCagesmallintnullupdateClasssetCage=casewhenClno='00311'then(selectAVG(Sage)fromSt
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 北師大版四年級下冊數(shù)學第5單元單元認識方程綜合測試卷(含答案)
- 知識產(chǎn)權教育普及與維權意識提升
- 2025年三噸雙卷筒機動絞磨項目投資可行性研究分析報告
- 申請報到證申請書
- 2025年電梯變壓器項目可行性研究報告
- 電子商務平臺的大數(shù)據(jù)決策支持實踐
- 部編版:2022年七年級《道德與法治》上冊第七章試卷以及答案
- 基礎化學模擬題及答案
- 知識產(chǎn)權申請?zhí)嵘髽I(yè)競爭力的關鍵
- 長春科技學院《集成電路版圖設計》2023-2024學年第二學期期末試卷
- 學校保潔服務投標方案(技術標)
- 青島中國(山東)自由貿(mào)易試驗區(qū)青島片區(qū)(青島前灣綜合保稅區(qū))管理委員會選聘35人筆試歷年參考題庫附帶答案詳解
- 《社區(qū)工作者培訓課件 新浪版》
- 教育信息化背景下的學術研究趨勢
- 人教版小學數(shù)學(2024)一年級下冊第五單元100以內(nèi)的筆算加、減法綜合素養(yǎng)測評 B卷(含答案)
- 2025江蘇常州溧陽市部分機關事業(yè)單位招聘編外人員78人歷年高頻重點提升(共500題)附帶答案詳解
- 2025年教科版科學五年級下冊教學計劃(含進度表)
- 2024年度體育賽事贊助合同:運動員代言與贊助權益2篇
- 智研咨詢發(fā)布:2024年中國新疫苗行業(yè)市場現(xiàn)狀、發(fā)展概況、未來前景分析報告
- 2022危險化學品及石化化工項目必須進園區(qū)的規(guī)定文件匯總
- 【單元設計】第七章《萬有引力與宇宙航行》單元教學設計及教材分析課件高一物理人教版(2019)必修第二冊
評論
0/150
提交評論