《》 mysql实用教程郑阿奇实验报告答案

python实用教程郑阿奇2020-09-28 19:50:10人已围观

SQL Server 实用教程(第3版)课后实验答案 郑阿奇主编的 邮箱344561468@qq.com

--查询全体学生的学号和姓名.

select Sno,Sname from Student

--查询全体学生细记录.

select * from Student

--查询所有选程生学号.

select distinct Sno from SC

--查询考试有格的学生学号.

select distinct Sno from SC where Grade<60

--查询不是信息系(is)、计算机系(cs)的学生性别、年龄、系别。

select Ssex,Sage,Sdept from Student where Sdept not in('is','cs')

--查询选修了4号课的学生学号和成绩,结果按成绩降序排列.

select Student.Sno,Grade from Student,SC where Cno='004' order by Grade desc

--查询每个课程号和相应的选课人数.

select Cno,count(Sno)选课人数 from SC group by Cno

--查询计算机系(cs)的学生姓名、年龄、系别。

select Sno,Sage,Sdept from Student where Sdept in('cs')

--查询年龄18~20岁的学生学号、姓名、系别、年龄。

select Sno,Sname,Sdept,Sage from Student where Sage between 18 and 20

--查询姓刘的学生的情况.

select * from Student where Sname like '刘%'

--查询既选修1号课程,又选修2号课程的学生学号.

select Sno from SC where Cno='001' and Cno='002'

select sno from SC where Cno='001' and Sno in (select Sno from SC where Cno='002')

select sno from SC where Cno='001' intersect select Sno from SC where Cno='002'

--查询学生的姓名和出生年份(今年2008年)

select Sname,2008-Sage as 出生年份 from student

--查询没有成绩的学生学号和课程号。

select Sno,Cno from sc where grade is null

--查询总成绩大于200分的学生学号。

select Sno from sc group by sno having sum(grade)>200

--查询每门课程不及格学生人数。

select cno,count(sno) 不及格人数 from sc where grade<60 group by cno

--查询不及格课程超过3门的学生学号。

select Sno from sc where grade<60 group by sno having count(grade)>3

--查询年龄为10~19岁的学生信息。

select * from student where Sage between 10 and 19

--查询全体学生情况,按所在系升序排列,同一个系的学生按年龄降序排列。

select * from student order by sdept, sage desc

--查询选了1号课程的学生平均成绩。

select avg(grade) from sc where cno='001'

--查询选了3号课程的学生的最高分。

select max(grade) from sc where cno='003'

--查询每个同学的总成绩。

select sno,sum(grade) 总成绩 from sc group by sno

---实验五

--查询每个学生及其选课情况。

select student.*,sc.*,course.* from student,sc,course where student.sno=sc.sno and sc.cno=course.cno

--select * from sc,student,course

--查询每门课程的间接选修课。

select first.cno,second.cpno from course first,course second where first.cpno=second.cno;

--将STUDENT,SC进行右连接。

select * from student,sc

select student.*,sc.* from student right join sc on student.sno=sc.sno

--查询有不及格学生的姓名和所在系。

select Sname,Sdept from student,sc where grade<60 and student.sno=sc.sno

--查询所有成绩为优秀(大于90)的学生姓名。

select Sname from student where sno in (select sno from sc group by sno having min(grade)>90)and sno not in (select sno from sc where grade is null) --错误

select sname from student,sc where student.sno=sc.sno and student.sno not in(select sno from sc where grade is null) group by sname having min(grade)>=90

--查询既选修了2号课程又选修了3号课程的学生姓名、学号。

select distinct Sname,Sc.Sno from student,sc where student.sno=sc.sno and sc.sno in(select sno from sc where cno='002' and sno in (select sno from sc where cno='003'))

--查询和刘晨同一年龄的学生。

select Sno,sname from student where sage=(select sage from student where sname='刘晨')

--选修了课程名为“数据库”的学生姓名和年龄。

select Sname,Sage from student where sno in(select sno from sc where cno=(select cno from course where cname='数据库'))

--查询其他系比IS系任一学生年龄小的学生名单。

select sname from student where sdept!='is'and sage

--查询其他系中比IS系所有学生年龄都小的学生名单。

select Sname from student where sdept!='is' and sage

--查询选修了全部课程的学生姓名.

select sname from student where not exists(select * from course where not exists(select * from sc where sno=student.sno and cno=course.cno)) --正确

--查询计算机系学生及其性别是男的学生.

select * from student where sdept='is' or ssex='男'

--查询选修课程1的学生集合和选修2号课程学生集合的差集。

select sc.sno from student,sc where student.sno=sc.sno and cno='001'

except

select sc.sno from student,sc where student.sno=sc.sno and cno='002'

--或者

select sno from sc where cno='001' and sno not in (select sno from sc where cno='002')

--查询李丽同学不学的课程的课程号.

select distinct cno from sc where cno not in (select cno from student,sc where sname='李丽'and student.sno=sc.sno)

--查询选修了3号课程的学生平均年龄.

select avg(sage) from student where sno in(select sno from sc where cno='003')

--求每门课程学生的平均成绩.

select cno,avg(grade) from sc group by cno

--统计每门课程的学生选修人数(超过3人的人统计)。要求输出课程号和选修人数,结果按人数降序排列,若人数相同,按课程号升序排列。

--查询学号比刘晨大,而年龄比他小的学生姓名。

select sname from student where sno>(select sno from student where sname='刘晨')and sage

--求年龄大于女同学平均年龄的男同学的姓名和年龄。

select sname,sage from student where sage>(select avg(sage) from student where ssex='女')and ssex='男'

--求年龄大于所有女同学年龄的男同学姓名和年龄。

select sname,sage from student where sage>(select max(sage) from student where ssex='女')and ssex='男'

--查询至少选修了08002选修的全部课程的学生号码。

--select cno from sc where sno='08002'

--select sno from sc where cno IN (select cno from sc where sno='08002')

--select * from sc A,sc B where A.SNO=B.SNO

--select * from (select distinct* from sc A,sc B where A.SNO=B.SNO)as e

select distinct sno from sc sc1 where not exists (select * from sc sc2 where sc2.sno='08002' and not exists (select * from sc sc3 where sc3.sno=sc1.sno and sc3.cno=sc2.cno))

--查询08001和08002两个学生都选修的课程的信息。

select course.* from course,sc where sno='08001' and course.cno=sc.cno intersect select course.* from course,sc where sno='08002' and course.cno=sc.cno

--查询跟'08001'同学同姓的学生信息

select * from student where sname like(select left(sname,1) from student where sno='08001') '%'

mysql实用教程郑阿奇实验报告答案

select max(字段名) from 表名

版权声明:本站所有文章皆为原创,欢迎转载或转发,请保留网站地址和作者信息。

python实用教程答案 郑阿奇_《》 mysql实用教程郑阿奇实验报告答案相关推荐

  1. python实现循环赛日程表问题的算法_循环赛日程表的分治算法实现实验报告gxl.doc...

    循环赛日程表的分治算法实现实验报告gxl PAGE PAGE 2 深 圳 大 学 实 验 报 告 课程名称: 算法设计与分析 实验项目名称: 分治算法 --矩阵相乘的Strassen算法及时间复杂性分 ...

  2. python实现循环赛日程表问题的算法_循环赛日程表的分治算法实现实验报告_gxl.doc...

    循环赛日程表的分治算法实现实验报告_gxl 深 圳 大 学 实 验 报 告 课程名称: 算法设计与分析 实验项目名称: 分治算法 --矩阵相乘的Strassen算法及时间复杂性分析 或--循环赛日程表 ...

  3. python实验报告代写价格_代写OS python程序作业、代写代写OS作业、代写OS实验报告...

    代写OS python程序作业.代写代写OS作业.代写OS实验报告 日期:2018-06-11 03:21 CSE 304 - Operating Systems DUE: June 11. Subm ...

  4. 科大奥锐干涉法测微小量实验的数据_大学物理实验报告答案解析大全(实验数据).doc...

    HYPERLINK "/source/2123275" 大 HYPERLINK "/source/2123275" 学物理实验报告答案大全(实验数据及思考题答案 ...

  5. c语言设计实验报告答案,武汉理工大学《C语言程序设计》实验报告答案

    武汉理工大学<C语言程序设计>实验报告答案 注:在Visual C++ 6.0编译环境中亲自调试通过,但不保证在Turbo C中通过. 实验二 选择结构的程序设计 (题目当初没抄下来,这是 ...

  6. 太原理工大学linux与python编程r实验报告_太原理工大学算法设计与分析实验报告...

    <太原理工大学算法设计与分析实验报告>由会员分享,可在线阅读,更多相关<太原理工大学算法设计与分析实验报告(12页珍藏版)>请在人人文库网上搜索. 1.本科实验报告课程名称: ...

  7. c语言初步实验报告,c语言实验报告(大一c语言实验报告答案)

    哪位帮我一下啊,我这有个作业,要写C语言程序设计实验报告,包括五个部. 最低0.27元/天开通百度文库会员,可在文库查看完整内容> 原发布者:aming7728081 计算机科学与技术系C语言实 ...

  8. 湖北理工学院c语言实验报告答案,湖北理工学院c语言实验报告七答案.doc

    湖北理工学院c语言实验报告七答案.doc 实验七 结构体和共用体实验课程名高级语言程序设计(C)专业班级 学号 姓名 实验时间 实验地点 指导教师 一.实验目的和要求1. 掌握结构体类型变量的定义和使 ...

  9. matlab的程序设计实验报告答案,实验二 MATLAB程序设计(含实验报告).doc

    实验二 MATLAB程序设计(含实验报告) 实验二 MATLAB程序设计 实验目的 1.掌握利用if语句实现选择结构的方法. 2.掌握利用switch语句实现多分支选择结构的方法. 3.掌握利用for ...

最新文章

  1. Python中使用数据库SQLite
  2. Pytorch之GPU加速计算问题以及model=model.to(device)
  3. javascript中的异步 macrotask 和 microtask 简介
  4. 【hdu 1573 X问题】【 hdu3579 Hello Kiki 】【poj 2891】
  5. 【CyberSecurityLearning 58】PHP代码注入
  6. 获取webbrowser中元素的屏幕坐标
  7. epoll.h 源码记录
  8. no applicable action for [springProfile], current ElementPath is [[configuration][springProfile]]
  9. image是否有disabled属性_8、背景属性
  10. 超能竞速大开眼界,iQOO 5系列正式发布
  11. python表格控件_python--excel操作插件openpyxl
  12. 计算机找不到链接打印机主机,电脑连接打印机厂商型号没有怎么办
  13. 学习笔记(27):玩转Python-Python3基础入门-案例-快递价格计算器(2)
  14. 2021裁判文书网抓取
  15. 浪潮服务器dhcp修改ip,dhcp服务器ip地址池修改
  16. HDLBits刷题Day6
  17. 用Python实现自动扫雷
  18. 课题申请的技术指标是什么
  19. ViewPager的使用及获取子view控件的操作(inflate)
  20. 极速pdf文件打印时此计算机未连接到网络,PDF文件不能打印的五种解决方案

热门文章

  1. 第二家东南亚美股上市公司诞生,Grab为何上市即大跌?
  2. python购物系统
  3. N103_考虑周末及法定上班和休假日计算工作日时长
  4. Microsoft SQL Server 2019 下载、安装及Java JDBC配置连接数据库(多图详解 超详细)
  5. 固态硬盘插口类型有几种,有什么区别,哪种最好
  6. 杭电ACM 2036 改革春风吹满地
  7. 灰色系统理论及其应用 (六) :SARS 疫情对某些经济指标影响问题
  8. 操作系统 | PV操作七大经典问题 生产者消费者 读者写者 哲学家进餐 理发师理发睡觉 和尚打水 吸烟者 吃水果
  9. 微信收款机具在慢速网络中快速收款的技术揭秘
  10. Inkscape裁剪图片(pdf,svg,png,jpg)