34,588
社区成员
发帖
与我相关
我的任务
分享
1.select distinct sno,sname from student st where exists(
select 1 from sc where sno=st.sno and grade<60)
2. select sname from student st where exists(
select 1 from sc join course on sc.sno=st.sno and sc.cno=course.cno
join teacher on course.tno=teacher.tno and teacher.name='李峰'
)
3. select cname from course left join sc on course.cno=sc.cno and sc.cno is null
4. select cno from sc group by cno having count(1)<10
5. select sno,sname from student where exists (
select 1 from sc where sno=st.sno and grade<60
)group by sno,sname having count(1)=4
6. select tno,tname from teacher te join(
select tno from course group by tno having COUNT(1)>3
)t on tempdb.tno=t.tno
)