帮做几个SQL选择语句吧。。。在线等
(1)查询没有选修任何一门课的学生的姓名、学号。(2)查询19~21岁的女生的姓名、年龄、课程号、成绩。(3)查询比平均成绩低的学生的姓名、课程名、成绩。(4)查询选修课...
(1)查询没有选修任何一门课的学生的姓名、学号。
(2)查询19~21岁的女生的姓名、年龄、课程号、成绩。
(3)查询比平均成绩低的学生的姓名、课程名、成绩。
(4)查询选修课程号为“T10102”的不及格学生的姓名和成绩。
学生表(student):sno sname gender(性别) department(系) age
课程表(course):cno cname credit(学分)
选课表(SC表):sno cno grade (成绩)
知道在请尽快告诉我吧,急。。。。不知道在别浪费时间!! 展开
(2)查询19~21岁的女生的姓名、年龄、课程号、成绩。
(3)查询比平均成绩低的学生的姓名、课程名、成绩。
(4)查询选修课程号为“T10102”的不及格学生的姓名和成绩。
学生表(student):sno sname gender(性别) department(系) age
课程表(course):cno cname credit(学分)
选课表(SC表):sno cno grade (成绩)
知道在请尽快告诉我吧,急。。。。不知道在别浪费时间!! 展开
5个回答
展开全部
1.select sno,Sname from student where sno not in (select sno from sc)
2.select a.sName,a.age,c.cName,c.grade from student a
inner join sc b on a.Sno=b.sno
inner join course c on c.cno=b.cno
where a.age bwtween 19 and 21 and a.gender='女'
3.select a.Sname,c.grade from student a
inner join sc b on a.Sno=b.sno
inner join course c on c.cno=b.cno
inner join
(select sno,cno,avg(grade) avggrade from SC
group by sno,cno
) d on a.sno=d.sno and b.cno=d.cno
where c.Grade<模圆游d.avggrade
--这个要上机旦销验证下,我没数据腔好库
4.select a.Sname,c.grade from student a
inner join sc b on a.Sno=b.sno
inner join course c on c.cno=b.cno
where b.cname='T10102' and c.grade<60
2.select a.sName,a.age,c.cName,c.grade from student a
inner join sc b on a.Sno=b.sno
inner join course c on c.cno=b.cno
where a.age bwtween 19 and 21 and a.gender='女'
3.select a.Sname,c.grade from student a
inner join sc b on a.Sno=b.sno
inner join course c on c.cno=b.cno
inner join
(select sno,cno,avg(grade) avggrade from SC
group by sno,cno
) d on a.sno=d.sno and b.cno=d.cno
where c.Grade<模圆游d.avggrade
--这个要上机旦销验证下,我没数据腔好库
4.select a.Sname,c.grade from student a
inner join sc b on a.Sno=b.sno
inner join course c on c.cno=b.cno
where b.cname='T10102' and c.grade<60
展开全部
(1) select sno,sname from student a
where not exists(select * from SC b where a.sno=b.sno)
(2) select a.sname,a.age,b.cno,b.grade from student a,SC b
where a.sno=b.sno and a.age between 19 and 21 and a.gender='备吵女'
(3) select a.sname,b.cname,c.grade from student a,course b,SC c,
(select cno,avg(grade) from SC group by cno) d
where a.sno=c.sno and b.cno=c.cno and c.cno=d.cno and
c.grade<汪滚冲d.grade
(4) select a.sname,b.grade from student a,SC b where b.cno='T10102'困歼
and b.grade<60 and a.sno=b.sno
where not exists(select * from SC b where a.sno=b.sno)
(2) select a.sname,a.age,b.cno,b.grade from student a,SC b
where a.sno=b.sno and a.age between 19 and 21 and a.gender='备吵女'
(3) select a.sname,b.cname,c.grade from student a,course b,SC c,
(select cno,avg(grade) from SC group by cno) d
where a.sno=c.sno and b.cno=c.cno and c.cno=d.cno and
c.grade<汪滚冲d.grade
(4) select a.sname,b.grade from student a,SC b where b.cno='T10102'困歼
and b.grade<60 and a.sno=b.sno
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
1,select sname,sno from student,SC where student.sno not in (select sno from SC)
2,select sname,age,cno,grade from student,course,SC
where age between 19 and 21 and gender='女'
3,select sname,cname,grade from student,course,SC
where sno=(select sno from SC where grade<avg(grade))
4select sname,grade from student,SC
where cno='T10102'扮孝and grade<6这个答厅稿稿案我没空检验,自己再改改敬颤吧。
2,select sname,age,cno,grade from student,course,SC
where age between 19 and 21 and gender='女'
3,select sname,cname,grade from student,course,SC
where sno=(select sno from SC where grade<avg(grade))
4select sname,grade from student,SC
where cno='T10102'扮孝and grade<6这个答厅稿稿案我没空检验,自己再改改敬颤吧。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
数据库发下
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2009-07-09
展开全部
为什么要查询19--21 岁女生的姓名呢?难道LZ有不可告人的秘密??!!
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询