当前位置:首页 > 考研资讯 > 正文内容

查询每门成绩(查询每门成绩最低的学生的学号和课程号)

2023-04-17 13:18:50考研资讯

查询每门成绩最低的学生的学号和课程号

select 姓名,课程名,成绩 from (课程名所在的表名 C join 成绩所在的表名 S on C.课程号=S.课程号) join 学生信息表 on S.学号=学生信息表.学号 ;具体的例子:select Sname,Cname,Grade from Student st left join(Score s left join Course c on s.Cno=c.Cno) on st.Sno=s.Sno;

查询每门课程中低于该课程平均成绩的学生学号和姓名

为一寸或二寸

大学生证件照是大学入学后由学校统一采集的,一般会同时收取纸质相片不少于4张,以及证件照电子版。

查找每门课程最低成绩信息,要求显示学生姓名

用户名是身份证号,密码是考生自己设置的密码。 关于考生网上报名密码遗忘时重置密码方式的说明   考生在进行中小学教师资格考试网上报名期间,如果遗忘密码可登录报名网页,点击“忘记密码”选项。目前报名系统支持以下几种途径,考生可按照提示进行相关操作来重置网上报名的系统密码。   登陆报名网页: 途径1:   如果个人基本信息里填写的手机号正确无误,请选择“1.短信获取密码”,输入姓名及身份证号,系统会将新密码通过短信发到你的手机上。 途径2:   如果考生记得注册时所填的密码保护问题答案,请选择“2.自助重置密码”,输入姓名及身份证号,点击“下一步”,然后输入密码保护问题答案,点击“重置密码”即可获取新密码。 途径3:   如果考生通过以上两种方式皆无法重置密码,请拔打客服热线(010-82345677),客服人工在核验考生身份后,进行人工重置密码操作。由于考生数量较多,客服人员工作压力较大,如客服电话占线,敬请谅解。

查询每门课程最高分的学生学号

oracle数据库网上经典45道练习题及答案写法(有删减)

/*CREATE TABLE STUDENT1

(SNO VARCHAR(3) NOT NULL,

SNAME VARCHAR(4) NOT NULL,

SSEX VARCHAR(2) NOT NULL,

SBIRTHDAY DATE,

CLASS NUMBER NOT NULL);

CREATE TABLE COURSE1

(CNO VARCHAR(5) NOT NULL,

CNAME VARCHAR(10) NOT NULL,

TNO VARCHAR(10) NOT NULL);

CREATE TABLE SCORE1

(SNO VARCHAR(3) NOT NULL,

CNO VARCHAR(5) NOT NULL,

DEGREE NUMBER NOT NULL);

CREATE TABLE TEACHER1

(TNO VARCHAR(3) NOT NULL,

TNAME VARCHAR(4) NOT NULL,

TSEX VARCHAR(2) NOT NULL,

TBIRTHDAY DATE NOT NULL,

PROF VARCHAR(6),

DEPART VARCHAR(10) NOT NULL);*/

/*INSERT INTO STUDENT (SNO,SNAME,SSEX,SBIRTHDAY,CLASS) VALUES (108 ,‘曾华’ ,‘男’ ,to_date(‘1977-09-01’,‘yyyy-mm-dd’),95033);

INSERT INTO STUDENT (SNO,SNAME,SSEX,SBIRTHDAY,CLASS) VALUES (105 ,‘匡明’ ,‘男’ ,to_date(‘1975-10-02’,‘yyyy-mm-dd’),95031);

INSERT INTO STUDENT (SNO,SNAME,SSEX,SBIRTHDAY,CLASS) VALUES (107 ,‘王丽’ ,‘女’ ,to_date(‘1976-01-23’,‘yyyy-mm-dd’),95033);

INSERT INTO STUDENT (SNO,SNAME,SSEX,SBIRTHDAY,CLASS) VALUES (101 ,‘李军’ ,‘男’ ,to_date(‘1976-02-20’,‘yyyy-mm-dd’),95033);

INSERT INTO STUDENT (SNO,SNAME,SSEX,SBIRTHDAY,CLASS) VALUES (109 ,‘王芳’ ,‘女’ ,to_date(‘1975-02-10’,‘yyyy-mm-dd’),95031);

INSERT INTO STUDENT (SNO,SNAME,SSEX,SBIRTHDAY,CLASS) VALUES (103 ,‘陆君’ ,‘男’ ,to_date(‘1974-06-03’,‘yyyy-mm-dd’),95031);

commit;*/

/*INSERT INTO COURSE(CNO,CNAME,TNO)VALUES (‘3-105’ ,‘计算机导论’,825);

INSERT INTO COURSE(CNO,CNAME,TNO)VALUES (‘3-245’ ,‘操作系统’ ,804);

INSERT INTO COURSE(CNO,CNAME,TNO)VALUES (‘6-166’ ,‘数据电路’ ,856);

INSERT INTO COURSE(CNO,CNAME,TNO)VALUES (‘9-888’ ,‘高等数学’ ,100);

commit;*/

/*INSERT INTO SCORE(SNO,CNO,DEGREE)VALUES (103,‘3-245’,86);

INSERT INTO SCORE(SNO,CNO,DEGREE)VALUES (105,‘3-245’,75);

INSERT INTO SCORE(SNO,CNO,DEGREE)VALUES (109,‘3-245’,68);

INSERT INTO SCORE(SNO,CNO,DEGREE)VALUES (103,‘3-105’,92);

INSERT INTO SCORE(SNO,CNO,DEGREE)VALUES (105,‘3-105’,88);

INSERT INTO SCORE(SNO,CNO,DEGREE)VALUES (109,‘3-105’,76);

INSERT INTO SCORE(SNO,CNO,DEGREE)VALUES (101,‘3-105’,64);

INSERT INTO SCORE(SNO,CNO,DEGREE)VALUES (107,‘3-105’,91);

INSERT INTO SCORE(SNO,CNO,DEGREE)VALUES (108,‘3-105’,78);

INSERT INTO SCORE(SNO,CNO,DEGREE)VALUES (101,‘6-166’,85);

INSERT INTO SCORE(SNO,CNO,DEGREE)VALUES (107,‘6-106’,79);

INSERT INTO SCORE(SNO,CNO,DEGREE)VALUES (108,‘6-166’,81);

commit;*/

/*INSERT INTO TEACHER(TNO,TNAME,TSEX,TBIRTHDAY,PROF,DEPART) VALUES (804,‘李诚’,‘男’,to_date(‘1958-12-02’,‘yyyy-mm-dd’),‘副教授’,‘计算机系’);

INSERT INTO TEACHER(TNO,TNAME,TSEX,TBIRTHDAY,PROF,DEPART) VALUES (856,‘张旭’,‘男’,to_date(‘1969-03-12’,‘yyyy-mm-dd’),‘讲师’,‘电子工程系’);

INSERT INTO TEACHER(TNO,TNAME,TSEX,TBIRTHDAY,PROF,DEPART) VALUES (825,‘王萍’,‘女’,to_date(‘1972-05-05’,‘yyyy-mm-dd’),‘助教’,‘计算机系’);

INSERT INTO TEACHER(TNO,TNAME,TSEX,TBIRTHDAY,PROF,DEPART) VALUES (831,‘刘冰’,‘女’,to_date(‘1977-08-14’,‘yyyy-mm-dd’),‘助教’,‘电子工程系’);

commit;*/

–1、查询Student表中的所有记录的Sname、Ssex和Class列。

select sname,ssex,class

from student1;

–2、查询教师所有的单位即不重复的Depart列。

select distinct depart

from teacher1;

–3、查询Student表的所有记录。

select * from student1;

–4、查询Score表中成绩在60到80之间的所有记录。

select * from score1

where degree<80 and degree>60;

–5、查询Score表中成绩为85,86或88的记录。

select * from score1

where degree=85 or degree=86 or degree=88;

–6、查询Student表中“95031”班或性别为“女”的同学记录。

select * from student1

where class=‘95031’ or ssex=‘女’;

–7、以Class降序查询Student表的所有记录。

select * from student1

order by class desc;

–8、以Cno升序、Degree降序查询Score表的所有记录。

select * from score1

order by cno asc,degree desc;

–9、查询“95031”班的学生人数。

select count(1)

from student1

where class=‘95031’;

–10、查询Score表中的最高分的学生学号和课程号。

select *

from (select sno,cno,degree

from score1

group by sno,cno,degree

order by degree desc)

where rownum<2;

–11、查询‘3-105’号课程的平均分。

select avg(degree)

from score1

where cno=‘3-105’;

–12、查询Score表中至少有5名学生选修的并以3开头的课程的平均分数。

in ----- exists

select cno,avg(degree)

from score1

where cno in (select cno

from score1

where cno like ‘3%’

group by cno

having count(cno)>=5)

group by cno;

–13、查询最低分大于70,最高分小于90的Sno列。

select sno

from score1

group by sno

having min(degree)>70 and max(degree)<90;

–14、查询所有学生的Sname、Cno和Degree列。

select sname,cno,degree

from student1,score1

where student1.sno=score1.sno

group by sname,cno,degree;

–17、查询“95033”班所选课程的平均分。

select avg(degree)

from score1,student1

where student1.sno=score1.sno and class=‘95033’;

–19、查询选修“3-105”课程的成绩高于“109”号同学成绩的所有同学的记录。

select sno,cno,degree from score1

where cno=‘3-105’ and degree>(select degree

from score1 where sno=‘109’ and cno=‘3-105’);

(有问题)–20、查询score中选学一门以上课程的同学中分数为非最高分成绩的记录。

select * from (select sno,cno,degree from score1

group by sno,cno,degree

having count(cno)>1

order by sno asc,degree asc)

where degree != (select max(degree) from(select sno,cno,degree from score1

group by sno,cno,degree

having count(cno)>1));

–21、查询成绩高于学号为“109”、课程号为“3-105”的成绩的所有记录。

select distinct * from score1

where degree>(select degree

from score1

where sno=‘109’ and cno=‘3-105’);

–22、查询和学号为108的同学同年出生的所有学生的Sno、Sname和Sbirthday列。

select sno,sname,sbirthday

from student1

where to_char(sbirthday,‘yyyy’)=(select to_char(sbirthday,‘yyyy’) from student1 where sno=‘108’)

and sno<>‘108’;

–23、查询“张旭“教师任课的学生成绩。

select degree

from teacher1,score1,course1

where teacher1.tno=course1.tno and score1.cno=course1.cno and tname=‘张旭’;

–24、查询选修某课程的同学人数多于5人的教师姓名

select tname

from teacher1

where tno=(select tno from (select tno,course1.cno from score1,course1

where score1.cno=course1.cno group by tno,course1.cno

having count(1)>5));

–25、查询95033班和95031班全体学生的记录。

select * from student1

where class in (‘95033’,‘95031’)

order by class asc;

–26、查询存在有85分以上成绩的课程Cno.

select distinct cno

from score1

where degree>85;

–27、查询出“计算机系“教师所教课程的成绩表。

select course1.tno,degree

from score1,course1,teacher1

where score1.cno=course1.cno and teacher1.tno=course1.tno

and depart=‘计算机系’

group by course1.tno,degree;

–32、查询所有“女”教师和“女”同学的name、sex和birthday.

select sname,ssex,sbirthday,tname,tsex,tbirthday

from student1,course1,score1,teacher1

where student1.sno=score1.sno and

score1.cno=course1.cno and

teacher1.tno=course1.tno and

ssex=‘女’ and tsex=‘女’

group by sname,ssex,sbirthday,tname,tsex,tbirthday;—不全

分步查询

女学生:

select sname,ssex,sbirthday

from student1

where ssex=‘女’

group by sname,ssex,sbirthday;

女教师:

select tname,tsex,tbirthday

from teacher1

where tsex=‘女’

group by tname,tsex,tbirthday;

–33、查询成绩比该课程平均成绩低的同学的成绩表。

select sno,cno,degree

from score1 b

where degree<(select avg(degree) from score1 a where a.cno=b.cno)

group by sno,cno,degree;

–34、查询所有任课教师的Tname和Depart.

select distinct tname,depart

from teacher1,course1,score1

where score1.cno=course1.cno and teacher1.tno=course1.tno;

–35、查询所有未讲课的教师的Tname和Depart.

select tname,depart from teacher1

where tname not in (select distinct tname

from teacher1,course1,score1

where score1.cno=course1.cno and teacher1.tno=course1.tno);

–36、查询至少有2名男生的班号。

select class

from student1

where ssex=‘男’

group by class

having count(ssex)>=2;

–37、查询Student表中不姓“王”的同学记录。

select * from student1

where sname not like ‘王%’;

–38、查询Student表中每个学生的姓名和年龄。

select sname,floor(months_between(sysdate,sbirthday)/12) “年龄”

from student1;

–39、查询Student表中最大和最小的Sbirthday日期值。

select max(sbirthday),min(sbirthday)

from student1;

–40、以班号和年龄从大到小的顺序查询Student表中的全部记录。

select sno,sname,ssex,sbirthday,class,floor(months_between(sysdate,sbirthday)/12) “年龄”

from student1

group by sno,sname,ssex,sbirthday,class

order by class desc,“年龄” desc;

–41、查询“男”教师及其所上的课程。

select course1.cno,tname,tsex,cname

from course1,teacher1,score1

where score1.cno=course1.cno and teacher1.tno=course1.tno and tsex=‘男’

group by course1.cno,tname,tsex,cname;

–42、查询最高分同学的Sno、Cno和Degree列。

select *

from (select sno,cno,degree from score1 group by sno,cno,degree

order by degree desc)

where rownum <2;

–43、查询和“李军”同性别的所有同学的Sname.

select sname

from student1

where ssex=(select ssex from student1 where sname=‘李军’) and sname !=‘李军’;

–44、查询和“李军”同性别并同班的同学Sname.

select sname

from student1

where ssex=(select ssex from student1 where sname=‘李军’) and

class=(select class from student1 where sname=‘李军’) and

sname !=‘李军’;

–45、查询所有选修“计算机导论”课程的“男”同学的

select student1.sno,sname,ssex,degree

from student1,score1,course1

where score1.cno=course1.cno and student1.sno=score1.sno and cname=‘计算机导论’ and

ssex=‘男’

group by student1.sno,sname,ssex,degree;

查询每位学生成绩的最高分和最低分

1.在excel表格中输入每个班级的不同成绩,需要统计每个班级的最高分。

2.在F1单元格中点击“fx”插属入一个“max”函数。

3.然后在参数设置的窗口中选中“B1:E1”的单元格区域。

4.点击确定即可生成结果为“94”,同时下拉公式批量生成不同班级的最高分。

“查询每门成绩(查询每门成绩最低的学生的学号和课程号)” 的相关文章