华南农业大学数据库系统概念实验报告三

华南农业大学数据库系统概念实验报告三

ID:23480833

大小:1.03 MB

页数:10页

时间:2018-11-08

华南农业大学数据库系统概念实验报告三_第1页
华南农业大学数据库系统概念实验报告三_第2页
华南农业大学数据库系统概念实验报告三_第3页
华南农业大学数据库系统概念实验报告三_第4页
华南农业大学数据库系统概念实验报告三_第5页
资源描述:

《华南农业大学数据库系统概念实验报告三》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、.《数据库系统》实验报告三学号姓名实验时间2014-11-26实验名称数据查询实验学时4准备材料1.SQLPlus命令手册2.Oracle数据字典扩展实验1.利用企业管理器的图形界面构造查询语句,并察看查询结果2.利用企业管理器完成视图、索引的创建与使用。3.利用DBMS进行对第三章习题所设计SQL语句的检查(此部分内容不要求在实验室完成,不用写入实验报告。)实验环境Oracle9i(及以上版本)服务器SQLPlus/SQLPlusworksheet客户端实验目的1.掌握使用SQL语句进行数据查询的方法2.掌握视图的创建与使用方法3.观察索引的使用效果实验内容及步骤1.

2、使用University数据库的数据库结构和数据(smallRelations即可),完成下列查询:(1)FindthenamesofcoursesinComputersciencedepartmentwhichhave3creditsSELECTtitleFROMcourseWHEREdept_name='Comp.Sci.'ANDcredits=3...(2)ForthestudentwithID12345(oranyothervalue),showallcourse_idandtitleofallcoursesregisteredforbythestudent.S

3、ELECTcourse_id,titleFROMtakesNATURALJOINcourseWHEREid=123454.Asabove,butshowthetotalnumberofcreditsforsuchcourses(takenbythatstudent).Don'tdisplaythetot_credsvaluefromthestudenttable,youshoulduseSQLaggregationoncoursestakenbythestudent....SELECTid,SUM(credits)FROMtakesNATURALJOINstudentN

4、ATURALJOINcourseWHEREid=12345GROUPBYid;(3)Asabove,butdisplaythetotalcreditsforeachofthestudents,alongwiththeIDofthestudent;don'tbotheraboutthenameofthestudent.(Don'tbotheraboutstudentswhohavenotregisteredforanycourse,theycanbeomitted)SELECTid,SUM(credits)FROMtakesNATURALJOINstudentNATURA

5、LJOINcourseGROUPBYid...(4)FindthenamesofallstudentswhohavetakenanyComp.Sci.courseever(thereshouldbenoduplicatenames)SELECTDISTINCTid,NAMEFROMtakesNATURALJOINstudentWHEREcourse_idIN(SELECTcourse_idFROMcourseWHEREdept_name='Comp.Sci.')(5)DisplaytheIDsofallinstructorswhohavenevertaughtacour

6、se(Notesad1)Oracleusesthekeywordminusinplaceofexcept;(2)interpret"taught"as..."taughtorisscheduledtoteach")SELECTidFROMinstructorWHEREidNOTIN(SELECTDISTINCTidFROMteaches)(6)Asabove,butdisplaythenamesoftheinstructorsalso,notjusttheIDs.SELECTid,NAMEFROMinstructorWHEREidNOTIN(SELECTDISTINCT

7、idFROMteaches)...(7)Findthemaximumandminimumenrollmentacrossallsections,consideringonlysectionsthathadsomeenrollment,don'tworryaboutthosethathadnostudentstakingthatsectionSELECTmax(enrollment),min(enrollment)from(SELECTsec_id,semester,year,COUNT(DISTINCTid)asenrollmentFRO

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。