现有三张表
表A:学生ID、学生名
表B:课程ID、课程名
表C:学生ID、课程ID、成绩
如果想输出下列值:
参加了某门课程的所有学生的学生名、课程名、成绩
SQL语句该怎么写?用一句SQL语句能实现吗?
SQL code:
select a.学生名,b.课程名,c.成绩
from a ,b,c
where a.学生ID = c.学生ID and c.课程ID = b.课程ID and b.课程名 = '某门课程'
SQL code:
select
a.学生名,b.课程名,c.成绩
from
a,b,c
where
a.学生ID=c.学生ID
and
b.课程ID=c.课程ID
and
b.课程ID=xx
SQL code:
select
a.学生名,b.课程名,c.成绩
from
a,b,c
where
a.学生ID=c.学生ID
and
b.课程ID=c.课程ID
and
b.课程名='xx'
SQL code:
select a,学生名,b.课程名,c.成绩 from a join c on a.学生ID=c.学生ID join b on c.课程ID=b.课程ID where b.课程名='某门课程名'
SQL code:
select a.学生名,b.课程名,c.成绩 from a,b,c
where a.学生ID=c.学生ID and b.课程I
id url rank ......