1 / 12

助教: 干艳桃、张榆

第三章 作业点评. 助教: 干艳桃、张榆. Contact 干艳桃. Email:ganyantao19901018@163.com. 总体情况. 提交情况 : 5 位 同学未交作业: 陈拓、孔令晗、詹捷浩、王党同、王灏 6 位同学 未交齐: 陈东旭、刘一骄、刘地、许翠、田城宇、蔡云川. 1. 完成情况: 抄袭现象 严重; SQL 语句书写不规范; 不能正确书写复杂 SQL 语句。. 2. 作业 点评 chapter 3. 数据库系统概论 Introduction to Database Systemse. of. 2. 12. 成绩分布.

nemo
Download Presentation

助教: 干艳桃、张榆

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 第三章作业点评 助教: 干艳桃、张榆 Contact 干艳桃 Email:ganyantao19901018@163.com

  2. 总体情况 • 提交情况: • 5位同学未交作业: • 陈拓、孔令晗、詹捷浩、王党同、王灏 • 6位同学未交齐: • 陈东旭、刘一骄、刘地、许翠、田城宇、蔡云川 1 • 完成情况: • 抄袭现象严重; • SQL语句书写不规范; • 不能正确书写复杂SQL语句。 2 作业点评 chapter 3 数据库系统概论 Introduction to Database Systemse of • 2 12

  3. 成绩分布 作业点评 chapter 3 数据库系统概论 Introduction to Database Systemse of • 3 12

  4. 4.4 第4(4)题 Q:求没有使用天津供应商生产的红色零件的工程号JNO SELECT JNO FROM J WHERE JNO NOT IN (SELECT JNO FROM SPJ, P, S WHERE S.SNO = SPJ.SNO AND P.PNO = SPJ.PNO AND S.CITY = ‘天津’ AND P.COLOR = ‘红’) SELECT JNO FROM P, S, SPJ WHERE S.SNO = SPJ.SNO AND P.PNO = SPJ.PNO AND S.CITY != ‘天津’ AND P.COLOR != ‘红’ 作业点评 chapter 3 数据库系统概论 Introduction to Database Systemse of 4 12

  5. 4.4 第4(4)题 Q:求没有使用天津供应商生产的红色零件的工程号JNO SELECT JNO FROM J WHERE NOT EXISTS (SELECT * FROM SPJ, P, S WHERE J.JNO = SPJ.JNO AND S.SNO = SPJ.SNO AND P.PNO = SPJ.PNO AND S.CITY = ‘天津’ AND P.COLOR = ‘红’) 作业点评 chapter 3 数据库系统概论 Introduction to Database Systemse of 5 12

  6. 4.5 第4(5)题 Q:求至少用了供应商S1供应的全部零件的工程号JNO 1. SELECT JNO FROM SPJ WHERE SNO = ‘S1’ 2. SELECT JNO FROM SPJ WHERE PNO=‘P1’ AND JNO IN (SELECT JNO FROM SPJ WHERE PNO=‘P2’) SELECT DISTINCT JNO FROM SPJ X WHERE NOT EXISTS (SELECT * FROM SPJ Y WHERE SNO = ‘S1’ AND NOT EXISTS (SELECT * FROM SPJ Z WHERE Z.PNO=Y.PNO AND Z.JNO=X.JNO) 不存在这样的零件y 供应商S1供应了y 工程x未选用y 作业点评 chapter 3 数据库系统概论 Introduction to Database Systemse of 6 12

  7. 5.6 第5(6)题 • Q:找出使用上海产的零件的工程名称 SELECT DISTINCT JNAME FROMJ WHEREJNO IN ( SELECT * FROM SPJ,S WHERE SPJ.SNO=S.SNO AND S.CITY=‘上海’) • 当能确定内层查询返回的是单值时,可以用比较运算符。 SELECT SNO, PNO, QTY FROMSPJ WHEREJNO = ( SELECT JNO FROM J WHERE JNAME=‘三建’) 作业点评 chapter 3 数据库系统概论 Introduction to Database Systemse of 7 12

  8. 5.7 第5(7)题 Q:找出没有使用天津产的零件的工程号码 SELECT JNO FROM J WHERE JNO NOT IN (SELECT JNO FROM SPJ, S WHERE S.SNO = SPJ.SNO AND S.CITY = ‘天津’ ) 作业点评 chapter 3 数据库系统概论 Introduction to Database Systemse of 8 12

  9. 5.10 第5(10)题 Q:从供应商关系中删除S2的记录,并从供应情况关系中删除相应的记录 SPJ S DELETEFROM SPJ WHERE SNO=‘S2’ DELETE FROM S WHERE SNO=‘S2’ 作业点评 chapter 3 数据库系统概论 Introduction to Database Systemse of 9 12

  10. 5.11 第5(11)题 Q:请将(S2, J6, P4, 200)插入SPJ表 INSERT INTO SPJ (SNO, JNO, PNO, QTY) VALUES (‘S2’, ‘J6’, ‘P4’, 200) • 表名后面添加列名,默认为所有列且按照建表时的顺序排列各属性 • 字符类型的值需要加单引号(如CHAR, VARCHAR),数值类型不加(INT, DOUBLE) 作业点评 chapter 3 数据库系统概论 Introduction to Database Systemse of 10 12

  11. 优秀作业 • 刘力 • 马丹 • 刘阳 作业点评 chapter 3 数据库系统概论 Introduction to Database Systemse of 11 12

  12. THANK YOU Contact 干艳桃 Email:ganyantao19901018@163.com 作业点评 chapter 3

More Related