select 练习4
21、查询score中选学多门课程的同学中分数不是所有成绩中最高分成绩的记录。
select * from score where cno in(select cno from score group by cno having count(1)>1) and degree<>(select max(degree) from score);

24、查询选修某课程的同学人数多于5人的教师姓名。
select t.tname from teacher t join course c on t.tno = c.tno where c.cno in (select cno from score group by cno having count(1)>5);

26、 查询存在有85分以上成绩的课程Cno.
select cno from score where degree in (select degree from score group by degree having degree>85);

27、查询出“计算机系“教师所教课程的成绩表。
select s.* from score s join course c on s.cno = c.cno join teacher t on t.tno = c.tno where t.depart = '计算机系';

28、查询“计算机系”与“电子工程系“不同职称的教师的Tname和Prof。
select t.tname,t.prof from teacher t where t.prof in(select t.prof from teacher t group by t.prof having count(1)=1)

29、查询选修编号为“3-105“课程且成绩至少高于选修编号为“3-245”的同学的Cno、Sno和Degree,并按Degree从高到低次序排序。
select cno,sno,degree from score where cno='3-105'
and degree>=(select min(degree) from score where cno='3-245') order by degree desc;

30、查询选修编号为“3-105”且成绩高于选修编号为“3-245”课程的同学的Cno、Sno和Degree.
select cno,sno,degree from score where cno='3-105' and degree> (select max(degree) from score where cno='3-245');

31、 查询所有教师和同学的name、sex和birthday.
select s.sname,s.ssex,s.sbirthday from student s union select t.tname,t.tsex,t.tbirthday from teacher t;

32、查询所有“女”教师和“女”同学的name、sex和birthday.
select s.sname,s.ssex,s.sbirthday from student s where s.ssex='女' union select t.tname,t.tsex,t.tbirthday from teacher t where t.tsex='女';

select 练习4的更多相关文章
- 最全的ORACLE-SQL笔记
-- 首先,以超级管理员的身份登录oracle sqlplus sys/bjsxt as sysdba --然后,解除对scott用户的锁 alter user scott account unloc ...
- Matplotlib数据可视化(6):饼图与箱线图
In [1]: from matplotlib import pyplot as plt import numpy as np import matplotlib as mpl mpl.rcParam ...
- SELECT INTO 和 INSERT INTO SELECT 两种表复制语句
Insert是T-sql中常用语句,Insert INTO table(field1,field2,...) values(value1,value2,...)这种形式的在应用程序开发中必不可少.但我 ...
- select、poll、epoll之间的区别总结
select.poll.epoll之间的区别总结 05/05. 2014 select,poll,epoll都是IO多路复用的机制.I/O多路复用就通过一种机制,可以监视多个描述符,一旦某个描述符就绪 ...
- LINQ to SQL Select查询
1. 查询所有字段 using (NorthwindEntities context = new NorthwindEntities()) { var order = from n in contex ...
- ADO.NET一小记-select top 参数问题
异常处理汇总-后端系列 http://www.cnblogs.com/dunitian/p/4523006.html 最近使用ADO.NET的时候,发现select top @count xxxx 不 ...
- iosselect:一个js picker项目,在H5中实现IOS的select下拉框效果
具体文档和demo可以访问github:https://github.com/zhoushengmufc/iosselect 移动端浏览器对于select的展示样式是不一致的,ios下是类似原生的pi ...
- SQL Server中SELECT会真的阻塞SELECT吗?
在SQL Server中,我们知道一个SELECT语句执行过程中只会申请一些意向共享锁(IS) 与共享锁(S), 例如我使用SQL Profile跟踪会话86执行SELECT * FROM dbo.T ...
- (转载) Linux IO模式及 select、poll、epoll详解
注:本文是对众多博客的学习和总结,可能存在理解错误.请带着怀疑的眼光,同时如果有错误希望能指出. 同步IO和异步IO,阻塞IO和非阻塞IO分别是什么,到底有什么区别?不同的人在不同的上下文下给出的答案 ...
- 基于select的python聊天室程序
python网络编程具体参考<python select网络编程详细介绍>. 在python中,select函数是一个对底层操作系统的直接访问的接口.它用来监控sockets.files和 ...
随机推荐
- CRM HomePage.aspx
//added by bgx on 20160616 //隐藏指定title按钮 function hideISVButton(buttonTitle) { var comps = document. ...
- MATLAB那些常见的命令
1.clear :清除内存变量和函数,也就是把WorkSpace的变量给清空: 2.clc :清楚当前Matlab命令窗口的内容:相当于清楚屏幕吧,重新开始,简洁一点,注意clc是不清 楚变量的.一般 ...
- Python基础篇【第1篇】: Python基础
Python 简介 Python 是一个高层次的结合了解释性.编译性.互动性和面向对象的脚本语言. Python 的设计具有很强的可读性,相比其他语言经常使用英文关键字,其他语言的一些标点符号,它具有 ...
- Django views 中 View decorators
decorators(装饰器) 1. require_http_methods 在django.views.decorators.http中,可以用来限制请求的权限. require_http_met ...
- strong reference cycle in block
However, because the reference is weak, the object that self points to could be deallocated while th ...
- Android自动化初探:ADB
Info:经过一段时间的准备,从今天开始自学Android之旅,初步学习会有疏漏,以后的每篇文章,我都会不断修改补全,直到完美. 2014-10-09:初版 --------------------- ...
- [oracle] update和merge语句的几点写法
1.update t2 set parentid=(select ownerid from t1 where t1.id=t2.id); 2. update tb_client_win_lost_re ...
- NHibernate系列文章十一:NHibernate并发控制
摘要 在同一时刻数据访问量和更新次数比较大的系统中,产生了数据的并发访问问题.并发访问使得在这样的环境中,所有用户(程序.实际用户.进程.线程等)的操作不产生负面问题. 如果不使用并发,在两个用户同时 ...
- Android IOS WebRTC 音视频开发总结(六九)-- qq视频通话都是p2p,我们还怕啥?
本文主要介绍在线教育这个行业,文章最早发表在我们的微信公众号上,支持原创,详见这里, 欢迎关注微信公众号blackerteam,更多详见www.rtc.help 先简单介绍什么是p2p? p是peer ...
- [已解决]EnvironmentError: mysql_config not found
$ pip install MySQL-python==1.2.5 报错: EnvironmentError: mysql_config not found 原因是缺少包 libmysqlclient ...