數(shù)據(jù)庫技術(shù)試題樣卷_第1頁
數(shù)據(jù)庫技術(shù)試題樣卷_第2頁
數(shù)據(jù)庫技術(shù)試題樣卷_第3頁
數(shù)據(jù)庫技術(shù)試題樣卷_第4頁
數(shù)據(jù)庫技術(shù)試題樣卷_第5頁
已閱讀5頁,還剩3頁未讀 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)

文檔簡介

1、中南大學考試試卷20 -20 學年 下 學期 時間100分鐘 數(shù)據(jù)庫應用基礎 課程 48 學時 3 學分 考試形式: 閉 卷 專業(yè)年級: 商學院 級 總分100分,占總評成績70%注:請將答案直接寫在試卷上!在本試卷中除特殊說明外數(shù)據(jù)庫系統(tǒng)為SQL SERVER,均采用下列表:學生信息表Student(NO,NAME,AGE,SEX,CLASS,NA),其字段名分別表示學號(CHAR(4)、姓名(VARCHAR(8)、年齡(INT)、性別(CHAR(2)、班級(VARCHAR(4))、民族(VARCHAR(18),主鍵為NO。教師信息表T (NO,NAME,sex,ab), 其字段名分別表示教

2、師編號(Char(4)、姓名(varchar(8)、性別(char(2))、職稱(Varchar(6),主鍵為NO。課程信息表C(NO,NAME, TNO),其字段名分別表示課程編號(Char(4)、課程名稱(VARCHAR(12)、授課教師編號(varchar(4),主鍵為(NO,TNO)。學生選課及成績表SC(NO,CNO,Tno,GRADE),其字段名分別表示學號(char(4))、課程編號(char(4)、授課教師編號(varchar(4),成績(int), 主鍵為(NO,CNO,Tno)。在企業(yè)管理器中按下列方式錄入數(shù)據(jù)保存。Student的數(shù)據(jù)NONameAgeSexCLASSNA

3、0101劉琳19女1002漢族0105王剛21男1015苗族0102李曉20女1015土家族0110張明NULL男1002漢族0108周冰21女1015苗族2031NULL20男1002漢族T的數(shù)據(jù)NONameSexAB1003劉瑞女講師2020陳曉男副教授0102李斌女教授C的數(shù)據(jù)NONameTNO2010數(shù)據(jù)庫技術(shù)10032010數(shù)據(jù)庫技術(shù)01022015高等數(shù)學2020SC的數(shù)據(jù)NOCNOTnoGRADE010520101002880108201010039010102010100386010120101002NULL01052015202078010220101002NULL01102

4、015202082010820152020NULL01022015202085011220152020NULL一、判斷下列關(guān)系模式最高屬于第幾范式,并解釋原因(本題20分,判斷正確得1分,解釋原因正確得3分)(1)R(A,B,C,D,E) F:BC,ABD;1(2)R(A,B,C,D,E) F:ABC, BD, DE ;1(3)R(A,B,C,D,E) F:ABEC, CBD2(4)R(A,B,C,D,E) F:ABC, ABD, CE,EC 3(5)R(A,B,C,D,E) F:ABC, CB, CD ,ABE 二、判斷下列描述或命令是否正確,如果不正確,請說明理由,并在不改變原來命令意義的

5、基礎上改正(共24分)(1)數(shù)據(jù)庫中有三類完整性約束:實體完整性、參照完整性和用戶定義的完整性。定義外鍵實現(xiàn)的是用戶定義完整性。(2)在數(shù)據(jù)庫的三級模式結(jié)構(gòu)中,描述數(shù)據(jù)庫中全體數(shù)據(jù)的全局邏輯結(jié)構(gòu)和特征的是外模式。當關(guān)系的型改變時,用戶程序也可以不變,這是數(shù)據(jù)的存儲獨立性。(3)關(guān)系表:學生(宿舍編號,宿舍地址,學號,姓名,性別,專業(yè),出生日期)滿足第三范式。(4)假設數(shù)據(jù)庫中已建好student表,并設置了no為主鍵,現(xiàn)欲對name字段建立索引操作:create clustered index ind_sname on name to student (5)查詢出土家族和苗族學生的有關(guān)信息。s

6、elect no,name,sex,class from student where na= 土家族 Union Select no,name,age,class from student where na=苗族(6)查詢課程號為2010課程最高分的學生學號及成績。select no,grade from sc where cno=2010 and grade=max(grade)(7)查詢還沒有錄入成績的學生學號及姓名。select no,name from student,sc where grade=null(8)insert into sc select no, cno from st

7、udent,c,sc where class=1002 and sc.no=student.no and name=數(shù)據(jù)庫技術(shù)三、寫出下列命令的結(jié)果。(本題32分)(1) select student.no,,student.class,o,sc.grade from student,sc,C where student.no=sc.no and o=c.no and ='高等數(shù)學' order by sc.grade(2)Select student.class,o,avg(grade),count(cno) from student,sc

8、 where student.no=sc.no group by student.class,o having count(cno)>=1(3) Select no, cno, grade from sc where no in(select no from student where NA=漢族) (4) Select * from student where sex='男' and no in (select no from sc where cno in (select no from c where name='數(shù)據(jù)庫技術(shù)' and tno in

9、(select no from t where name like '劉%') (5) Select avg(grade) from sc, student, c, t where sc.no=student.no and o=c.no and c.tno=t.no and ='高等數(shù)學' Group by student.class(6)Select sc.no from student, sc, c, t where sc.no=student.no and o=c.no and c.tno=t.no and t.ab not like '

10、;教授' group by sc.no having count(sc.no)>=1(7)select student.*,o,sc.grade from student left outer join sc on student.no=sc.no where sex='男'(8) select no,class from student where name like '張%' and no in (select no from sc where student.no=sc.no)四、用一條命令完成下列操作(本題24分)1.用SQL的數(shù)據(jù)定義語言建立“學生選課及成績表”SC表,并定義其主碼。2.檢索所有漢族學生所選課程的課程編號及獲得的成績。3

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
  • 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

最新文檔

評論

0/150

提交評論