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 . 查询所有未讲课的教师的Tna…
9. 查询"95031"班的学生人数.…
23.查询"张旭"教师任课的学生成绩. select * from score s where cno in ( select cno from course where tno in( select tno from teacher where tname = '张旭')) 24.查询选修某课程的同学人数多于5人的教师姓名. select tname from teacher where tno in ( select tno from course where cno in ( s…
14.查询所有学生的Sname.Cno和Degree列. select t.sname,c.cno,c.degree from student t inner join score c on t.sno=c.sno…
1. 查询Student表中的所有记录的Sname.Ssex和Class列.…
ASP.NET操作ORACLE数据库之模糊查询 一.ASP.NET MVC利用OracleHelper辅助类操作ORACLE数据库 //连接Oracle数据库的连接字符串 string connectionString = @"Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP) (HOST=localhost) (PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=TestDB))); User…
oracle数据库经典SQL查询 .查看表空间的名称及大小 select t.tablespace_name, round(sum(bytes/(1024*1024)),0) ts_size from dba_tablespaces t, dba_data_files d where t.tablespace_name = d.tablespace_name group by t.tablespace_name; .查看表空间物理文件的名称及大小 select tablespace_name, …
本文来源:huang_xw 的<Oracle数据库的状态查询> 1 状态查询 启动状态 SQL语句 结果 nomount select status from v$instance; STARTED select open_mode from v$database; ERROR at line 1: ORA-01507: database not mounted mount select status from v$instance; MOUNTED select open_mode from…
参考文档:http://database.51cto.com/art/201108/288058.htm Oracle数据库日期范围查询有两种方式:to_char方式和to_date方式,接下来我们通过一个实例来介绍这一过程.我们假设要查询2011-05-02到2011-05-30之间的数据,实现方式如下: to_date方式: select * from tablename where time>= to_date('2011-05-02','yyyy-mm-dd') and time<=t…
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 = '电子工程系') 30.查询选修编号为"3-105"且成绩高于选修编号为&q…