【正文】
的最高分;查詢計算機(jī)系學(xué)生的最大年齡和最小年齡;統(tǒng)計每個系的學(xué)生人數(shù);統(tǒng)計每門課程號的選課人數(shù)和考試最高分;統(tǒng)計每個學(xué)生的選課門數(shù)和考試總成績,并按選課門數(shù)升序顯示結(jié)果;查詢總成績超過200分的學(xué)生,要求列出其學(xué)號和總成績;查詢選修C002課程的學(xué)生姓名和所在系;查詢成績80分以上的學(xué)生姓名、課程號和成績,并按成績降序排列結(jié)果;查詢哪些課程號沒有學(xué)生選修,要求列出課程號和課程名;查詢計算機(jī)系哪些學(xué)生沒有選課,列出學(xué)生姓名;查詢選修C001課程號的學(xué)生姓名和所在系;查詢通信工程系成績在80分以上的學(xué)生學(xué)號和姓名;查詢計算機(jī)系考試成績最高的學(xué)生姓名。查詢年齡最大的男學(xué)生的姓名和年齡;查詢C001課程號的考試成績高于該課程號平均成績的學(xué)生學(xué)號和成績;創(chuàng)建內(nèi)容為學(xué)生學(xué)號、姓名、所在系、課程號、課程名、課程學(xué)分的視圖;創(chuàng)建內(nèi)容為學(xué)生的學(xué)號、姓名、選修課程名和考試成績的視圖;創(chuàng)建內(nèi)容為統(tǒng)計每個學(xué)生的選課門數(shù)的視圖,要求列出學(xué)生學(xué)號和選課門數(shù);創(chuàng)建內(nèi)容為每個學(xué)生的選課總學(xué)分的視圖,要求列出學(xué)生學(xué)號和總學(xué)分(說明: 考試成績超過60才能獲得此課程的學(xué)分)刪除選課成績小于50分的學(xué)生的選課記錄;將所有選修C001課程的學(xué)生的成績加10分;將計算機(jī)所有選修“數(shù)據(jù)庫原理及應(yīng)用”課程的學(xué)生成績加10分。答案:Select * from sc;Select sname,sage from student where sdept=’計算機(jī)系’;Select sno,course,grade from sc where grade between 70 and 80;Select sname,sage from student where sdept=’計算機(jī)系’ and ssex=’男’ and sage between 18 and 20;Select max(grade) 最高分 from sc where o=’C001’;Select max(sage) 最大年齡,min(sage) 最小年齡 from student where sdetp=’計算機(jī)系’;Select sdept,count(*) 學(xué)生人數(shù) from student group by sdept;Select o,count(*) 選課人數(shù), max(grade) 最高分 from sc group by o;Select sno,count(*) 選課門數(shù), sum(grade) 總成績 from sc group by sno order by count(*);Select sno,sum(grade) 總成績 from sc group by sno having sum(grade)200;Select sname,sdept from student,sc where = and o=’C002’;Select sname,o,grade from student,sc where = and grade80 order by grade desc;SelectSelectSelectSelect sno,sname from student,sc where = and sdept=’通信工程系’ and grade80;SelectSelectSelect sno,grade from sc where grade(select avg(grade) from sc where o=’c001’) and o=’c001’;Create view view1 as select sno,sname,sdept,o,ame,ccredit from student,sc,course where = and =;Create view view2 as select sno,sname,ame,grade from student,sc,course where = and =;