有几个sql中的条件检索不懂啊!哪位大哥知道说下!~~

来源:百度知道 编辑:UC知道 时间:2024/07/02 16:13:37
sno cno score
98601 C601 90
98601 C602 90
98601 C603 85
98601 C604 87
98602 C601 90
98603 C601 75
98603 C602 70
98603 C604 56
98604 C601 90
98604 C604 85
98605 C601 95
98605 C603 80

以上是表course的数据
现在要检索
1. 检索选修课程号为C601和C603的学生学号
2.检索选修课程包含学号为98603的学生所修课程的学生学号。

哪位大哥大姐知道的说一下!~~
SNO为学生学号

1、
select sno
from tabel_name
where cno = 'c601'and cno='603'
2、
select sno
from tabel_name
where cno in (select cno
from tabel_name
where sno='98603')

1、
select sno
from sc
where cno='C601'and sno in
(select sno
from sc
where cno='C603')
go
或者
select x.sno
from sc x,sc y
where x.sno=y.sno and x.cno='C601' and y.cno='C603'
go

1.select sno from course where cno='C601' or cno='C603'

2.select sno from course where cno in (select cno from course where sno='98603')