设教学数据库中有3个关系:学生关系 S(Sno, Sname, Sage, Ssex)、学习关系 SC (Sno, Cno, Grade)、课程
发布网友
发布时间:2022-05-24 19:16
我来回答
共2个回答
热心网友
时间:2023-10-27 05:20
1、select s.sno,s.sname,sc.grade
from c join sc on c.cno=sc.cno
join s on s.sno=sc.sno
where c.cno='c2'
2、
select distinct s.sno,s.sname
from c join sc on c.cno=sc.cno and c.cno=‘c2’
join s on s.sno=sc.sno
3、
select s.sno,s.sname
from c join sc on c.cno=sc.cno
join s on s.sno=sc.sno
where c.cname='Maths'
4、
select s.sno,s.sname
from c join sc on c.cno=sc.cno
join s on s.sno=sc.sno
where c.cno in('c2','c4')
5、
select s.sname,s.sage
from c join sc on c.cno=sc.cno
join s on s.sno=sc.sno
where c.cno<>'c2'
热心网友
时间:2023-10-27 05:20
1)SELECT s.sno, sc.grade
FROM (s INNER JOIN sc ON s.sno = sc.sno) INNER JOIN c ON sc.cno = c.cno
WHERE (((c.cno)="c2"));
2)SELECT s.sno, s.sname
FROM (s INNER JOIN sc ON s.sno = sc.sno) INNER JOIN c ON sc.cno = c.cno
WHERE (((c.cno)="c2"));
3)SELECT s.sno, s.sname
FROM (s INNER JOIN sc ON s.sno = sc.sno) INNER JOIN c ON sc.cno = c.cno
WHERE (((c.cname)="maths"));
4)SELECT s.sno
FROM (s INNER JOIN sc ON s.sno = sc.sno) INNER JOIN c ON sc.cno = c.cno
WHERE (((c.cno)="c2")) OR (((c.cno)="c4"));
5)SELECT s.sname, s.sag
FROM (s INNER JOIN sc ON s.sno = sc.sno) INNER JOIN c ON sc.cno = c.cno
WHERE (((c.cno)<>"c2"));