Oracle数据库作业-6 查询成绩比该课程平均成绩低的同学的成绩表
33、 查询成绩比该课程平均成绩低的同学的成绩表。
select * from score a where a.degree between 0 and(
select avg(degree) from score b where a.cno=b.cno )
34、 查询所有任课教师的Tname和Depart.
select tname,depart from teacher where tno in(
select tno from course )
35 、 查询所有未讲课的教师的Tname和Depart.
select tname,depart from teacher where tno not in(
select tno from course )
36、查询至少有2名男生的班号。
select sclass from student where ssex = '男' group by sclass having count(sno)>=2
37、查询Student表中不姓“王”的同学记录。
select * from student where sname not like '王%'
38、查询Student表中每个学生的姓名和年龄。
39、查询Student表中最大和最小的Sbirthday日期值。
select max(t.sbirthday),min(t.sbirthday) from student t
40、以班号和年龄从大到小的顺序查询Student表中的全部记录。
select * from student order by sclass desc , sbirthday asc
41、查询“男”教师及其所上的课程。
select tname , cname from teacher t ,course c where tsex = '男'and t.tno=c.tno
42、查询最高分同学的Sno、Cno和Degree列。
select * from score where degree =(
select max(degree) from score)
43、查询和“李军”同性别的所有同学的Sname.
select sname from student where ssex = (
select ssex from student where sname ='李军')
44、查询和“李军”同性别并同班的同学Sname.
select sname from student where ssex = (
select ssex from student where sname ='李军')
and sclass =(
select sclass from student where sname ='李军')
45、查询所有选修“计算机导论”课程的“男”同学的成绩表。
select * from score where sno in (
select sno from student where ssex = '男')
and cno in (
select cno from course where cname = '计算机导论')
Oracle数据库作业-6 查询成绩比该课程平均成绩低的同学的成绩表的更多相关文章
- Oracle数据库作业-4 查询
9. 查询"95031"班的学生人数.
- Oracle数据库作业-6 查询“张旭“教师任课的学生成绩。
23.查询"张旭"教师任课的学生成绩. select * from score s where cno in ( select cno from course where tno ...
- Oracle数据库作业-5 查询
14.查询所有学生的Sname.Cno和Degree列. select t.sname,c.cno,c.degree from student t inner join score c on t.sn ...
- Oracle数据库作业-3 查询
1. 查询Student表中的所有记录的Sname.Ssex和Class列.
- ASP.NET操作ORACLE数据库之模糊查询
ASP.NET操作ORACLE数据库之模糊查询 一.ASP.NET MVC利用OracleHelper辅助类操作ORACLE数据库 //连接Oracle数据库的连接字符串 string connect ...
- oracle数据库元数据SQL查询
oracle数据库经典SQL查询 .查看表空间的名称及大小 select t.tablespace_name, round(sum(bytes/(1024*1024)),0) ts_size from ...
- Oracle数据库的状态查询
本文来源:huang_xw 的<Oracle数据库的状态查询> 1 状态查询 启动状态 SQL语句 结果 nomount select status from v$instance; ST ...
- Oracle数据库日期范围查询的两种实现方式
参考文档:http://database.51cto.com/art/201108/288058.htm Oracle数据库日期范围查询有两种方式:to_char方式和to_date方式,接下来我们通 ...
- Oracle数据库作业-6 29、查询选修编号为“3-105“课程且成绩至少高于选修编号为“3-245”的同学的Cno、Sno和Degree,并按Degree从高到低次序排序。 select tname,prof from teacher where depart = '计算机系' and prof not in ( select prof from teacher where depart 。
29.查询选修编号为"3-105"课程且成绩至少高于选修编号为"3-245"的同学的Cno.Sno和Degree,并按Degree从高到低次序排序. selec ...
随机推荐
- Release 版本和 Debug 版本
什么是 Release 版本.Debug 版本? bug-缺陷,程序故障.而debug指的是排除缺陷,显然这个模式是面向开发者的. 而release是满足发布所用. Debug 和 Release,在 ...
- (剑指Offer)面试题15:链表中倒数第k个结点
题目: 输入一个链表,输出该链表中倒数第k个结点. 例如:链表中有6个结点,从头到尾依次为1,2,3,4,5,6,则该链表的倒数第3个结点为4. 链表结点定义: struct ListNode{ in ...
- HDU 2066 一个人的旅行 - from lanshui_Yang
Problem Description 虽然草儿是个路痴(就是在杭电待了一年多,居然还会在校园里迷路的人,汗~),但是草儿仍然很喜欢旅行,因为在旅途中 会遇见很多人(白马王子,^0^),很多事,还能丰 ...
- VPS之openVPN的安装配置
原文地址:http://www.blogjava.net/dongbule/archive/2010/11/01/336714.html 上次写的<VPS的购买和使用>中提到了openVP ...
- 上门洗车App 竟然是块大肥肉!
http://www.leiphone.com/k-xiche-app-idea.html 打车App.租车App.防违规App我们见得多,但洗车App你一定没听过,之前在一次创业路演上碰到一个做上门 ...
- PL/pgSQL学习笔记之十
http://www.postgresql.org/docs/9.1/static/plpgsql-declarations.html 39.3.3. 类型拷贝 variable%TYPE %TYPE ...
- Django 1.6 最佳实践: 如何设置django项目的设置(settings.py)和部署文件(requirements.txt)
Django 1.6 最佳实践: 如何设置django项目的设置(settings.py)和部署文件(requirements.txt) 作者: Desmond Chen,发布日期: 2014-05- ...
- C++学习笔记之迭代器
模板是的算法独立于存储的数据类型,而迭代器使算法独立于使用的容器类型.理解迭代器是理解STL的关键. 迭代器应该具备的特征: (1)应该能够对迭代器进行解除引用的操作,以便能够访问它引用的值.即如果P ...
- Java多线程:线程死锁
发生死锁的原因通常是两个对象的锁相互等待造成的. 以下用一个实例来构造这样的情况: package basic.e_deadlock; import org.apache.log4j.Logger; ...
- 《linux性能及调优指南》
http://blog.chinaunix.net/uid-26000296-id-4065871.html