使用标准SQL嵌套语句查询选修课程名称为’税收基础’的学员学号和姓名?
- select s.s#,s.sn from s
join sc on s.s#=sc.s#
join c on sc.c#=c.c#
where c.cn='税收基础' - 以我学习SQL的经验,这样应该就可以了select S.S#, SN from S, C, SC Where S.S#=SC.S# and C.C#=SC.C# and C.CN='税收基础';
- select S.S#, SNfrom S, C, SCwhere S.S#=SC.S# and C.C#=SC.C# and C.CN='税收基础'
以我学习SQL的经验,这样应该就可以了select S.S#, SN from S, C, SC Where S.S#=SC.S# and C.C#=SC.C# and C.CN='税收基础';
方法一:采用嵌套查询,两层大嵌套,总体思路是在学号是选修了现代数据库技术的学生中找选修了网络操作系统这门课的学生 select * from student where no in (select sno from sc where cno=(select cno from course where cname='网络操作系统'))and no in (select no from student where no in...
嵌套SELECT语句,即子查询,指一个SELECT语句查询结果作为另一个语句输入值。子查询能在Where子句、From子句和Select列表中使用,实现动态数据筛选和引用。单行子查询仅返回一行数据,通过比较符号(=, >, =,
1:select sno(学生的学号) from sc(学生选课表)group by sno having count(*)>1 2:select s.sno,s.name from student swhere s.sno in(select sno from score scgroup by sc.cno having sum(sc.sno)>2 )3:应为三张表;学生表A 课程表B 选修表C(cid aid bid)--没有选修任何...
-- 1、查询与10060101学生选修的全部课程相同的学生的学号、课程号、期末考试成绩select sno, cno, grade from sc a group by sno, cno, grade having a.sno'10060101' and not exists ((select cno from sc where sno='10060101') except (select cno from sc where sno=a.sno))...