实验报告R实践报告.docx
《实验报告R实践报告.docx》由会员分享,可在线阅读,更多相关《实验报告R实践报告.docx(16页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、实验报告团实践报告口课程名称: 数据库概论R实验名称: 交互式SQL语句的使用实验地点:行知楼A105教室专业班级:软件2016班 学号:学生姓名:宋雪姗指导教师:宋晓涛2022年4月20日3、用INSERT插入数据到表中。5insertintoStudent valuesC 20100001,李勇,男,20, CS, TOO】)insertintoStudent values C 20100002,刘晨,女,19, CS, 1001)insertintoStudent (Sno, Sname, Ssex, Sage, Sdept, Sclass) values20100021,王敏,女,18
2、, MA1002)insertintoStudent1 Sno, Sname, Ssex, Sage, Sdept, Sclass values 20100031,张立,男,19, IS, 1003insertintoStudent1Sno, Sname, Ssex, Sclass)values C 20100003*,J 刘洋,女,1001)insertintoStudent (Sno, Sname, Ssex, Sage, Sdept, Sclass) values(J 20100010,赵斌,男,19, IS, 1005)insertintoStudent valuesC 2010002
3、2,张明明,男,19, CS, 1002)insertintoCourse Cno, Cname, Cpno, Ccreditvalues Cl,数据库系统原理,5, 4)insertintoCourse Cno, Cname, Cpno, CcreditvaluesC 2,高等数学,null, 2)insertintoCourse Cno, Cname, Cpno, Ccreditvalues C 3,管理信息系统,1, 4)insertintoCourse Cno, Cname, Cpno, Ccreditvalues4,操作系统原理,飞,3)insertintoCourse Cno, C
4、name, Cpno, Ccreditvalues C 5,数据结构,7, 4)insertintoCourse Cno, Cname, Cpno, CcreditvaluesC 6,1 数据处理,null, 2)insertintoCourse Cno, Cname, Cpno, Ccreditvalues( 7, C语言,null, 4)insertintoSC valuesC 20100001?,1 V , 92)insertintoSC values (20100001,2, 85)insertintoSC values (20100001,3, 88)insertintoSC val
5、ues (20100002, 1, 90)insertintoSC values (20100002,2, 80)insertintoSC values, 20100003, T, null)insertintoSC valuesC 20100010, 3, null)H结果事消息CnoCnameCpnoCcreditSnoSnameSsexSageSdeptSclass11数据库系统原理54120100001李勇男20CS100122高等数学NULL2220100002刘晨女19CS1001133目理信息系统1i 4220100003刘洋女nullnull1001420100010八 J赵斌
6、男19IS100544操作系统原理63520100021王敏女18MA100255数据结构746201000221张明明1男19CS100266数据处理NULL2720100031张立男19IS100377C语言NULL4SnoCnoSage20100001 19223456720100001285201000013 J 882010000219020100002280201000031NULL201000103NULL4、用UPDATE、DELETE修改表中数据。Supdate Student set Sage=22 where Sno=,2010000T ;Supdate Student
7、set Sage=Sage+l;Supdate SC set Sage=85 where Sno=,2010000T and Cno=,3JSupdate SC set Sage=Sage+5 where CS=( select Sdept from Student where Student. Sno=SC. Sno:;Supdate SCI set Sage=80,where Cno=2and Sno in(select Sno from Student where Student. Sno=SC. Sno and Sname=,刘晨J; Hupdate Studentset Sno=,2
8、0100025 where Sno=,2010002T select* from Student select* from Course select* from SCEdeletefrom Studentwhere Sno/ 20100022,-select* into tmpSCfrom SCEdeletefrom tmpSCwhere Sno=,2010000T and Cno=,Tdeletefrom tinpSCwhere Sno=2010002, deletefrom tmpSCwhere CS=(select Sdept from Student where Student. S
9、no-tinpSC. Sno deletefrom tmpSCselect* from Studentselect* from Courseselect* from SC结果或消息SnoSnameSsexSageSdeptSclassi 20100001 ; ! !李勇男23CS100120100002刘晨女21CS100120100003刘洋女NULLNULL100120100010赵斌男21IS100520100022张明明男21CS100220100025王敏女20MA100220100031张立男21IS1003Cno Cname)1 I数据库系统原理2 高等数学3 管理信息系统4 操
10、作系统原理5 数据结构6 数据处理7 C语言Cpno Ccredit54NULL 2146 37 4NULL 2NULL 4结果或消息SnoSnameSsexSageSdeptSclassi 20100001 ; ! !李勇男23CS100120100002刘晨女21CS100120100003刘洋女NULLNULL100120100010赵斌男21IS100520100022张明明男21CS100220100025王敏女20MA100220100031张立男21IS1003Cno Cname)1 I数据库系统原理8 高等数学9 管理信息系统10 操作系统原理11 数据结构12 数据处理13
11、C语言Cpno Ccredit54NULL 2148 39 4NULL 2NULL 4结果或消息SnoSnameSsexSageSdeptSclassi 20100001 ; ! !李勇男23CS100120100002刘晨女21CS100120100003刘洋女NULLNULL100120100010赵斌男21IS100520100022张明明男21CS100220100025王敏女20MA100220100031张立男21IS1003Cno Cname)1 I数据库系统原理14 高等数学15 管理信息系统16 操作系统原理17 数据结构18 数据处理19 C语言Cpno Ccredit54
12、NULL 21410 311 4NULL 2NULL 4SnoCnoSage201000012952010000139020100002110020100002280201000031NULL201000103NULLra结果靠消息SnoSnameSsexSageSdeptSclass120100001李勇男23CS1001220100002刘晨女21CS1001320100003刘洋女NULLNULL1001420100010赵斌男21IS1005520100025王敏女20MA1002620100031张立男21IS1003CnoCnameCpnoCcredit11i数据库系统原理5422
13、高等数学NULL233管理信息系统1444操作系统原理6355数据结构7466数据处理NULL277c语言NULL4SnoCnoSage120100001110222010000129532010000139042010000211005201000022806201000031NULL7201000103NULL5、用SELECT进行选择、投影操作。select* from Student,100% I- SELECT Sname,1 Year of Birth:?, 2004 Sage, LOVER(Sdept, FROM Student, t SELECT Sname NAME, * Y
14、ear of Birt” BIRTH, 2000-Sage BIRTHDAY, LOVER(Sdept) DEPARTMENTSnoSnameSsexSageSdeptSclass120100001李勇男23CS1001220100002刘晨女21CS1001320100003刘洋女NULLNULL1001420100010赵斌男21IS1005520100025王敏女20MA1002620100031张立男21IS1003FROM Student |100% 剧结果南消息Sname(无列名)(无列名)(无列名)i|李勇Year of Birth:1981CS2刘晨Year of Birth:
15、1983CS3刘洋Year of Birth:NULLNULL4赵斌Year of Birth:1983is5王敏Year of Birth:1984ma6张立Year of Birth:1983isNAMEBIRTHBIRTHDAYDEPARTMENT1李勇Year of Birth1977CS2刘晨Year of Birth1979CS3刘洋Year of BirthNULLNULL4赵斌Year of Birth1979is5王敏Year of Birth1980ma6张立Year of Birth1979isE SELECT Sname FROM Student WHERE Sdept
16、=,CS ;SELECT Sname Sdept, Sage FROM Student WHERE Sage BETWEEN 20 AND 23SELECT Sname. Ssex FROM Student WHERE Sdept IN ( IS, MA, CS);SELECT Sname. Sno. Ssex FROM Student WHERE Sname LIKE 刘 ;SELECT Sno,Cno FROM SC WHERE Sage IS NULL;SELECT Sname FROM Student WHERE Sdept=,CS AND Sage 23;SELECT Sno. Sn
17、ame, Sage, Sdept FROM Student WHERE Sage 二 17,1& 20,23J,SELECT Sname, Sdept, Sage FROM Student WHERE Sage NOT BETWEEN 21 AND 24100% 剧结果价消息学号姓名性别年龄所在系120100001李勇男23CS220100002刘晨女21CS320100003刘洋女NULLNULL420100010赵斌男21IS520100025王敏女20MA620100031张立男21ISSno SnameSnoSnameSageSdept120100001李勇23CS220100025王
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 实验 报告 实践
限制150内