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的更多相关文章

  1. 最全的ORACLE-SQL笔记

    -- 首先,以超级管理员的身份登录oracle sqlplus sys/bjsxt as sysdba --然后,解除对scott用户的锁 alter user scott account unloc ...

  2. Matplotlib数据可视化(6):饼图与箱线图

    In [1]: from matplotlib import pyplot as plt import numpy as np import matplotlib as mpl mpl.rcParam ...

  3. SELECT INTO 和 INSERT INTO SELECT 两种表复制语句

    Insert是T-sql中常用语句,Insert INTO table(field1,field2,...) values(value1,value2,...)这种形式的在应用程序开发中必不可少.但我 ...

  4. select、poll、epoll之间的区别总结

    select.poll.epoll之间的区别总结 05/05. 2014 select,poll,epoll都是IO多路复用的机制.I/O多路复用就通过一种机制,可以监视多个描述符,一旦某个描述符就绪 ...

  5. LINQ to SQL Select查询

    1. 查询所有字段 using (NorthwindEntities context = new NorthwindEntities()) { var order = from n in contex ...

  6. ADO.NET一小记-select top 参数问题

    异常处理汇总-后端系列 http://www.cnblogs.com/dunitian/p/4523006.html 最近使用ADO.NET的时候,发现select top @count xxxx 不 ...

  7. iosselect:一个js picker项目,在H5中实现IOS的select下拉框效果

    具体文档和demo可以访问github:https://github.com/zhoushengmufc/iosselect 移动端浏览器对于select的展示样式是不一致的,ios下是类似原生的pi ...

  8. SQL Server中SELECT会真的阻塞SELECT吗?

    在SQL Server中,我们知道一个SELECT语句执行过程中只会申请一些意向共享锁(IS) 与共享锁(S), 例如我使用SQL Profile跟踪会话86执行SELECT * FROM dbo.T ...

  9. (转载) Linux IO模式及 select、poll、epoll详解

    注:本文是对众多博客的学习和总结,可能存在理解错误.请带着怀疑的眼光,同时如果有错误希望能指出. 同步IO和异步IO,阻塞IO和非阻塞IO分别是什么,到底有什么区别?不同的人在不同的上下文下给出的答案 ...

  10. 基于select的python聊天室程序

    python网络编程具体参考<python select网络编程详细介绍>. 在python中,select函数是一个对底层操作系统的直接访问的接口.它用来监控sockets.files和 ...

随机推荐

  1. ThinkPHP的路由形式

    首先解释一下,这里路由的意思是:系统从URL参数中分析出当前请求的分组.控制器.操作 .另外我的网址根目录是放在article目录下的,Thinkphp主要有下面几种路由形式 1.pathinfo路径 ...

  2. springMVC使用与生成序列号

    springMVC使用与生成序列号 我是以springMVC的方式提供序列号 代码可以直接在项目中用 第一步:controller类 @Autowired private PkGenerator pk ...

  3. CSS基础篇

    写的不错,收藏 http://www.cnblogs.com/suoning/p/5625582.html

  4. windows下PHP5.5.6+Apache2.4.7配置

    本文主要阐述在windows8及win8.1 环境下搭建PHP5.5.6+Apache2.4.7. 1.软件准备 apache 2.4.7:http://pan.baidu.com/s/1iUPif ...

  5. linux上安装配置vsftpd

    启动: /usr/sbin/vsftpd & 端口占用: lsof -i:21 位置: whereis vsftpd 默认配置下,匿名用户登录 vsftpd 服务后的根目录是 /var/ftp ...

  6. Jmeter上传文件

    Jmeter上传文件 一.Fiddler抓包获取表单信息 操作被测系统,上传文件,Fiddler抓包获取提交表单信息如下:

  7. Ubuntu 安装 fcitx 输入法

    fcitx 和 ibus一样都是输入法框架.下面介绍ubuntu下安装fcitx输入法. 1.先卸载系统中的输入法 2.安装. 增加ppa源:sudo add-apt-repository ppa:f ...

  8. php 学习使用

    https://netbeans.org/kb/docs/php/wish-list-lesson1_zh_CN.html#register-mysql http://www.php100.com/h ...

  9. nwe

    SELECT  SUBSTR('20150601', 1, 6) AS CALC_MONTH,       CHN.EMPLOYEE_CODE,       CHN.CHANNEL_TYPE,     ...

  10. java.io.Serializable 序列化问题

    java.io.Serializable 序列化问题 Person.java package a.b.c; public class Person implements java.io.Seriali ...