资源预览内容
第1页 / 共6页
第2页 / 共6页
第3页 / 共6页
第4页 / 共6页
第5页 / 共6页
第6页 / 共6页
亲,该文档总共6页全部预览完了,如果喜欢就下载吧!
资源描述
-1、显示系部编号为“”的系部名称!select departname as 系部名称from departmentwhere departno=03-2、查询系部名称中含有“工程”两个字的系的全名。select departname 系部名称from department where departname like%工程%-3、查询共有多少个系部。select departname 系部名称from departmentcompute count(departname)-4、查询“01”年级共有多少个班级。select count(classname) as 班级总数from classwhere classname like01%-5、查询在“周二晚”上课的课程名称和教师。select couname as 课程名称,teacher as 教师from coursewhere schooltime=周二晚-6、查询姓“张”、“陈”、“黄”同学的的基本信息,要求按照姓名降序排序。select *from studentWhere stuname like张% or stuname like陈% or stuname like黄%order by stuname desc-7、按系部统计课程的平均报名人数,要求显示系部编号、平均报名人数。select departno 系部编号,avg(willnum) 平均报名人数from coursegroup by departno-8、按系部统计课程的平均报名人数,要求显示系部名称、平均报名人数。select departname 系部名称,avg(willnum) 平均报名人数from course,department where course.departno=department.departnogroup by departname-9、统计各系的班级数,要求显示系部编号、系部名称、班级数量。select class.departno 系部编号,departname 系部名称,count(classname) 班级数量from class,department where class.departno=department.departnogroup by class.departno,departname-10、查询“甘蕾”同学选修的课程名、学分、上课时间、志愿号,按志愿号排序查询结果。select couname 课程名,credit 学分,schooltime 上课时间,willorder 志愿号from course,stucou,studentwhere course.couno=stucou.couno and student.stuno=stucou.stuno and stuname=甘蕾order by willorder -11、显示“电子商务班”班的选修报名结果。要求有学号、姓名、课程编号、-课程名称、志愿号,并按学号、志愿号排序。select student.stuno 学号,stuname 姓名,stucou.couno 课程编号,couname 课程名称,willorder 志愿号from student,course,stucou,classwhere course.couno=stucou.couno and student.stuno=stucou.stuno and class.classno=student.classno andclassname=00电子商务order by student.stuno,willorder-12、学号为“”的学生第一志愿报名选修“”这门课程,请在数据库中进行处理。insert stucouvalues (00000025,001,1,报名,NULL)-13、删除学号为“”的学生的选课报名信息。delete stucouwhere stuno=00000025-14、将“多媒体”班级“杜晓静”同学的名字修改为“杜小静”。update studentset stuname=杜小静from class,studentwhere class.classno=student.classno andclassname=00多媒体 andstuname=杜晓静-15、“电子商务”班的“林斌”同学申请将已选修的“网络信息检索原理与技术”课程修改为“Linux操作系统”。update stucouset couno=(select couno from course where couname=Linux操作系统)from course,stucou,student,classwhere course.couno=stucou.couno and student.classno=class.classno andstucou.stuno=student.stuno andclassname=00电子商务 and stuname=林斌 and couname=网络信息检索原理与技术 (注:可编辑下载,若有不当之处,请指正,谢谢!)
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号