1.查询S001学生选修而S003学生未选修的课程
select cno as 课程号 from sc where sno ='S001'
and cno not in (select cno from sc where sno ='S003')
2.sc
表中至少选修了’C001’与’C002’课程的学生学号(运气一好写对了,试了好久)
select sno as 学号 from sc where
sno in (select sno from sc where cno ='C001')
and cno = 'C002'
3.显示所有课程的基本信息,课程编号不足6位的,左侧补0
select LPAD(cno,6,'0') as 课程编号,cname as 课程名称,credit as 学分,attribute as 类别 from course