P127第3章SQL練習答案.doc_第1頁
P127第3章SQL練習答案.doc_第2頁
P127第3章SQL練習答案.doc_第3頁
P127第3章SQL練習答案.doc_第4頁
全文預覽已結束

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

第2章第5題(1) Select SNO From SPJ Where JNO=J1(2) Select SNO From SPJ Where JNO=J1 And PNO=P1(3) Select SNO From SPJ,P Where SPJ.PNO=P.PNO And JNO=J1 And Color=紅(4) select distinct jno from spj Where JNO not in (select distinct jno from spj,s,p where spj.sno=s.sno and p.pno=spj.pno and city=天津and color=紅)(5) select distinct jno from spj spjx where not exists(select * from spj spjy where spjy.sno=S1 and not exists (select * from spj spjz where spjz.jno=spjx.jno and spjz.pno=spjy.pno)第3章第5題(1) Select Sname,City From S (2) Select Pname,Color,Weight From P (3) Select Distinct JNO From SPJ Where SNO= S1(4) Select PNAME,QTY From SPJ,P Where SPJ.PNO=P.PNO And JNO= J2(5) Select Distinct PNO From SPJ ,SWhere SPJ.SNO=S.SNO And City= 上海(6) Select Distinct Jname From Spj,J,S Where SPJ.JNO=J.JNO And SPJ.SNO=S.SNO And S.City= 上海(7) Select Distinct Jno From Spj Where Jno Not In (Select Distinct Jno From Spj,S Where Spj.Sno=S.Sno And City=天津)(8) Update P Set Color=藍 Where Color=紅(9) Update Spj Set Sno=S3 Where Sno=S5 And Jno=J4 And Pno=P6(10) Delete From SPJ Where SNO=S2 Delete From S Where SNO=S2(11) Insert into SPJ Values (S2, J6, P4,200)圖書管理關系數據模型練習題答案:(1) Select 單位 From 讀者 Where 姓名=張平(2) Select 書名,作者 From 圖書 Where 出版單位=人民出版社 or出版單位=科學出版社(3) Select 書名 From 圖書 Where 單價 Between 10 And 15 Order By 單價 Desc(4) Select 姓名,借閱日期 From 讀者, 借閱 Where 借閱.借書證號=讀者.借書證號 (5) Select 圖書.* From 圖書,借閱 Where 圖書.總編號=借閱.總編號 and 單價20 Order By 單價 Desc(6) Select 圖書.* From 圖書 Where 出版單位=(Select 出版單位 From 圖書 Where 書名=數據庫原理 )(7) Select Count(*) From 讀者 Where 單位=計算機科學系 Group By 單位(8) Select Max(單價), Min(單價), Avg(單價) From 圖書 Group By 出版單位(9) Select 姓名,單位 From 讀者 Where 借書證號 Not In (Select Distinct 借書證號 From 借閱 )(10) Select 姓名,單位 From 圖書,讀者,借閱 Where 圖書.總編號=借閱.總編號 And 借閱.借書證號=讀者.借書證號 And 書名=數據結構(11) Select 姓名,單位 From 讀者,借閱 Where 讀者.借書證號=借閱.借書證號Group By 借閱.借書證號 Having Count(*)=5(12) Select 書名,作者 Fro

溫馨提示

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

評論

0/150

提交評論