【文章內(nèi)容簡介】
索引 索引的作用 創(chuàng)建索引的限制索引的分類如何定義不同類型的索引視圖視圖的作用和本質(zhì) 視圖如何定義單項選擇題(30分)簡答題(20分)綜合應(yīng)用題(40分)解答題(10分)查詢成績在70~80分之間的學(xué)生的學(xué)號、課程號和成績 select sno,o,grade from SC where grade between 70 and 80查詢計算機系年齡在18~20之間且性別為‘男’的學(xué)生的姓名和年齡 select sname,sage from student where sage between 18 and 20 and Sdepartment=39。計算機系39。 and Sex=39。男39。查詢計算機系的學(xué)生的姓名和年齡。 select sname,sage from student where Sdepartment=39。計算機系39。查詢沒有選課的同學(xué)的學(xué)號 select sno from student where sno not in (select sno from sc)查詢選修了‘c02’的學(xué)生的學(xué)號與課程號,以及課程的性質(zhì) select sno,o,xklb from sc where o=39。c0239。查詢計算機系,課程成績高于80分的同學(xué)的學(xué)號,姓名,選修課程的課程號,成績 select ,sname,o,grade from student,sc where = and Sdepartment=39。計算機系39。 and grade80查詢信息系,平均成績高于70分的同學(xué)的學(xué)號,平均成績select * from student,(select sno,avg(grade) gradefrom scgroup by snohaving avg(grade)70) awhere = and Sdepartment=39。信息系39。查詢平均成績高于80分的課程名select o,avg(grade) from scgroup by ohaving avg(grade)80查詢總成績超過180分的學(xué)生,要求列出學(xué)生的姓名,總成績,并按照總成績的高低進行降序排序select sno,sum(grade)from scgroup by snohaving sum(grade)170order by desc查詢與李勇選修同一門課程的學(xué)生的學(xué)號、姓名、課程號select sno,o from scwhere o in (select o from student,scwhere = and sname = 39。李勇39。)1查詢沒有選修數(shù)據(jù)庫基礎(chǔ)這門課程同學(xué)的姓名,年齡select sname,sage from studentwhere sno not in (select sno from course,scwhere = and Cname = 39。數(shù)據(jù)庫基礎(chǔ)39。)1查詢信息系,選修vb課程的學(xué)生人數(shù)select count(*) 39。人數(shù)39。 from studentwhere Sdepartment=39。信息系39。and sno in(select sno from course,scwhere = and Cname = 39。vb39。)題1 設(shè)有SPJ數(shù)據(jù)庫,包括供應(yīng)商表S,零件表P,工程項目表J,供應(yīng)情況表SPJ:S(SNO, SNAME, STATUS, CITY)P(PNO