sql语句在实际应用中咋使用;
发布网友
发布时间:2022-05-01 23:36
我来回答
共2个回答
热心网友
时间:2022-05-05 05:41
1、select sname from s where sno not in (select sno from sc where cno in (select cno from c where cteacher='李明')
2、select distinct b.sname,a.avg from
(select sno,count(cno),avg(scgrade) avg from sc group by sno having count(cno)>=2) a
left join s b on a.sno=b.sno
3、select sname from s where sno in (select sno from
(select sno ,count(con) from sc where con in (1,2) group by sno having count(con)>1))
4、select sno from sc where scgrade>(select scgrade from sc where con='1' and sno='2')
5、select a.sno,a.cno as cno_1,b.cno as cno_2 from
(select sno, cno,scgrade from sc where cno='1')a,
(select sno, cno,scgrade from sc where cno='2')b where a.sno=b.sno
热心网友
时间:2022-05-05 06:59
select s.sname from s where not exists(select 1 from c where c.sno=s.sno and c.cteacher='李明')