SQL语言 急等

来源:百度知道 编辑:UC知道 时间:2024/07/04 13:12:16
学生成绩管理系统有如下数据表。(共28分)
student(sno,sname,sage, ssex, sdept,sbz) 字段含义:学号,姓名,年龄,性别,系名,备注。
course(cno,cname,pcno,credit) 字段含义:课号,课程名称,先修课号,学分。
Sc(sno,cno,grade) 字段含义:学号,课号,成绩。
试用SQL语句完成以下功能(共30分,每小题3分)
① 查询年龄在10到19岁之间的学生信息
② 插入如下学生记录(学号:95030,姓名:李莉,年龄:18)
③ 删除张娜的选课记录
④ 把低于总平均成绩的女同学成绩提高5分
⑤ 计算机系学生年龄改成20
⑥ 数学系所有学生成绩改成0
⑦ 查询既选修1号课程,又选修2号课程的学生学号和成绩
⑧ 查询选了1号课程的学生平均成绩
⑨ 查询选了3号课程的学生的最高分
⑩ 查询每门课程不及格学生人数

我们的考试题 高分

1 select * from student where 年龄>9 and 年龄<20
2 insert into student(学号,姓名,年龄) values (95030,'李莉',18)
3 delete Sc where 学号 = (select 学号 from student where 姓名='张娜')
4 update course set 成绩=成绩+5 where 学号 in (select 学号 from student,Sc where 性别='女' and student.学号=Sc.学号 and 成绩< (select avg(成绩) from Sc))
5 update student set 年龄=20 where 系名='计算机'
6 update Sc set 成绩=0 where 学号 in (select 学号 from student where 系名='数学')
7 select 学号,sc1.成绩 as 成绩1,sc2.成绩 as 成绩2 from Sc as sc1 , Sc as sc2 where sc1.课号=1 and sc2.课号=2
8 select avg(成绩) from Sc where 课号=1
9 select max(成绩) from Sc where 课号=3
10 select 课号,count(*) as 不及格人数 from Sc where 成绩<60 group by 课号

1.select * from student where sage>10 and sage<19;
2.insert into student (sno,sname,sage) value('95030','李莉','18')
3.delect * from sc where sno=(select sno from student where sname='张娜')
4.update Sc s