大数据库课程设计报告材料完整版.docx
《大数据库课程设计报告材料完整版.docx》由会员分享,可在线阅读,更多相关《大数据库课程设计报告材料完整版.docx(26页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、实用文档江林大警数据库课程设计班级物联网1202学 号 3120611027姓名 杨璐指导老师年轶2014年1月标准文案Harrison*, 192660*, * Newport, CA,); INSERT INTO STUDENTVALUES473 I 1 Carol Dean 1 r * 983 Park Avenue r f 02169 1 , 1 Boston 1 , 1 MA1 , 1 F 1 ); INSERT INTO STUDENTVALUES(154 8 1 Allen thomas1, 1238 West OxRoad *, 160 6241, 1 Chicago 1f *
2、 IL 1, * M1 );INSERTINTO STUDENTVALUES(558 I Vai Shipp J r * 238 WestportRoad, 60556,,Chicago,工L,);INSERTINTO STUDENTVALUES(1649 1, 1 John Anderson 1473 Emmory Street *, f10008 * z 1 NewYork一NY M ); INSERT INTO STUDENTVALUES(654 I Janet Yhomas1, 1441 6th Street1 J 16510 Eri1, f PA1, 1F*); SELECT*FRO
3、M STUDENTTEACHER录入数据 INSERT INTO TEACHERVALUES(f303 1 Dr.Horn1A 1257-304 91, 2754 0.00);INSERTINTO TEACHERVALUES(f290 1 Dr.Lowe1z 1257-23 90* z 31450.00); INSERT INTO TEACHERVALUES430 I Dr .Engle I .56-46211 38200.00); INSERT INTO TEACHERVALUES(180, fDr.Cooke1,1257-80881,29560.00);INSERTINTO TEACHER
4、VALUES (560, 1 Dr. Olsen1, f257-808631778.00);INSERTINTO TEACHERVALUES(784, r.Scango1,1257-30461,32098.00);SELECT*FROM TEACHERSECT工ON表录入数据 INSERTINTO SECTIONVALUES ( ll 3031 450 12);INSERTINTO SECTIONVALUES (ll 290、FOL 6);INSERTINTO SECTIONVALUES (fl M301, !290 3);INSERTINTO SECTIONVALUES (ll 1801 4
5、80 13);INSERTINTO SECTIONVALUES ( 2 1 5601 J 450 12);INSERTINTO SECTIONVALUES(f2 f784f, M801,2);SELECT*FROM SECTIONENROLL表录入数据INSERTINTO ENROLLVALUES-730, ll 148 1 *3,);INSERTINTO ENROLLVALUES450, 2、210 1 3);INSERTINTO ENROLLVALUES (730, 1 - 210 - 1,);INSERTINTO ENROLLVALUES (f 290 1298 *3*);INSERTI
6、NTO ENROLLVALUES(14801z f21, !298 1 , 131);INSERTINTO ENROLLVALUES730 l I1, 348,2);INSERTINTO ENROLLVALUES290, ll f349 l 4);INSERTINTO ENROLLVALUES (480, ll 348J4);第10页INSERTINTO ENROLLVALUES480, 1、410 1INSERTINTO ENROLLVALUES450 I1, 1 473 I,2 )INSERTINTO ENROLLVALUES730 O J 473 IINSERTINTO ENROLLVA
7、LUES (480 1 ,2、473,INSERTINTO ENROLLVALUES290 I1, 1 548 I,2 )INSERTINTO ENROLLVALUES(730 I 1 I 558 IINSERTINTO ENROLLT4f)T4f)4)VALUES ( 730 1 649 IINSERTINTO ENROLLVALUES480 1 1 - 649 1INSERTINTO ENROLLVALUES ( 450 Ill 654 LINSERTINTO ENROLLVALUES (450 1 2 I ,548 1SELECT*FROM ENROLLCOURSE结果J消息enocna
8、medepartmentcredit1:290 English CompositionEnglish32450Western CivilizationHistory33480Compiler WritingComputer Science34730Calculus IvMath4第11页STUDENT口结果弟息snosnameaddresszipcitystatesex1148 Susan powell534 East River Dr19041HaverfordPAF2210Bob Dawson120 South Jefferson02891NewportRIM3298Howard Mans
9、field290 Wynkoop Drive22180ViennaVAM4348Susan Pugh534 East Hampton Dr06107HartfordCNF5349Joe Adams73 Emmerson Street19702NewarkDEM6354Janet Ladd441 10th Street18073Pennsb.PAF7410Bill Jone120 South Harrison92660NewportCAM8473Carol Dean983 Park Avenue02169BostonMAF9548Allen thomas238 West Ox Road60624
10、ChicagoILM10558Vai Shipp238 Westport Road60556ChicagoILF11649John Anderson473 Emmory Street10008New YorkNYM12654Janet Yhomas441 &h Street16510EriePAFTEACHER口结果消息tno tname口结果消息tno tname1: 1802、说3303443055606784Dr. Cooke Dr. Lowe Dr. Hom Dr .Engle Dr. Olsen Dr. Sea.phone257-8088257-2390257-30492564621
11、257-8086257-3046salary29560.0031450.0027540.0038200.0031778.0032098.00SECTION一I结果。消息secnotnoeno11| 180| 4802129073031303450414302905256045062784480secnotnoeno11| 180| 4802129073031303450414302905256045062784480sqty362322第12页ENROLLenosecnosnograde1I 290| 1298322901349432901548244502210354501473264502
12、5481745016544848022983查询已成功执行.enosecnosnograde8480229839 _480134841048014102114802473012480164941373011483147301210115730134821673014733177301558318730164944.检索系名为“Math”和“English”的课程信息SELECT *FROM COURSEWHERE department = 1 Math1 OR department = 1 English结果二)消息enocnamedepartmentcredit j1| 290 Englis
13、h CompositionEnglish32730Calculus IvMath45 ,按字母顺序列出教师姓名和 号码SELECT tname,phoneFROM TEACHERORDER BY tname第13页口结果消息tnamephone1:Dr.Cooke257-80882Dr. Engle25646213Dr. Hom257-30494Dr. Lowe257-23905Dr.Olsen257-80866Dr.Scango257-30466.检索 号码不是以“257”打头的教师姓名和 号码 SELECT tname,phone FROM TEACHERWHERE phone not l
14、ike * 257% *目结果直消息 tname phone1| Dr-Engle 1 25646217.检索数学系所有成绩大于3的课程名、系名、学分 SELECT cname,departmentA credit FROM COURSEWHERE eno IN (SELECT enoFROM ENROLLWHERE grade3 AND cno=73(T);cname department credit1 : Calculus Iv j Math 48查询已成功执行.8 .检索没有选修任何课的学生姓名、学号SELECT sno,snameFROM STUDENTWHERE NOT EXIST
15、S(SELECT *FROM ENROLLWHERE STUDENT.sno=ENROLL.sno);sno sname354 Janet Ladd为查询已成功执行。9 .检索没有选修课程“Calculus Iv”的学生学号SELECT snoFROM STUDENTWHERE sno NOT IN第14页(SELECT STUDENT.snoFROM COURSE,STUDENT,ENROLLWHERE cname=1 Calculus Iv ,AND COURSE.cno=ENROLL.eno AND STUDENT.sno=ENROLL.sno);结果u消息1 I 29823493354
16、441055486654*10.检索至少选修教师“Dr. Lowe所开全部课程的学生学号SELECT DINSTINCT snoFROM ENROLL ENROLLXWHERE NOT EXISTS(SELECT *FROM ENROLL ENROLLYWHERE eno in(SELECT enoFROM TEACHER,SECTION,WHERE tname=Dr.LoweAND TEACHER.tno=SECTION.tno)AND NOT EXISTS(SELECT *FROM ENROLL ENROLLZWHERE ENROLLZ.sno=ENROLLX.snoAND ENROLLZ
17、.cno=ENROLLY.eno)结果22103348447355586649Q查洵已成功执行。(修改数据验证,该老师教授课程号为730和500,只有学号148的学生同时选择了这两门 课)SECTION第15页secnotnoenosqty1| 1| 18048032129050013129073064130345025143029036 _256045027 _27844802ENROLL13500114831473011483结果施结果消息sno.谢.; ,/.检索每门课学生登记的人数、相应的课程名、课程号、分组号SELECT DISTINCT secno,ENROLL.eno,cname
18、,sqty FROM ENROLL,COURSE,SECTION WHERE SECTION.cno=ENROLL.enoAND COURSE.cno=ENROLL.eno11 .检索选修两门以上课程的学生姓名SELECT snameFROM STUDENTWHERE sno in (SELECT snoFROM ENROLLGROUP BY snoHAVING COUNT (*)2)snameCarol Dean.检索只有男生选修的课程和学生名SELECT cname,sname第16页FROM COURSE ,STUDENT ,ENROLLWHERE STUDENT.sno=ENROLL.
19、snoAND COURSE.cno=ENROLL.enoAND COURSE.eno in(SELECT enoFROM COURSEWHERE eno not in(SELECT DISTINCT enoFROM STUDENT r ENROLLWHERE sexand STUDENT.sno=ENROLL.sno)cnamesnameEnglish CompositionEnglish CompositionEnglish CompositionEnglish CompositionEnglish CompositionEnglish CompositionHoward Mansfield
20、Joe Adams Allen thomas查询已成功执行.12 .检索所有学生都选修的课程名、学生名、授课教师名、该生成绩SELECT cname,sname,tname,gradeFROM STUDENT ,TEACHER ,SECTION ,ENROLL , COURSE WHERE COURSE.cno=ENROLL.enoAND STUDENT.sno=ENROLL.snoAND TEACHER.tno=SECTION.tnoAND SECTION.cno=ENROLL.enoAND SECTION . secno=ENROLL.seconAND COURSE.cno=(SELECT
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 数据库 课程设计 报告 材料 完整版
限制150内