设教学用的四个基本表( S,C,T,SC) ( 2)查询年龄大于23 岁的女同学的学号和姓名 select 姓名,学号 from s where 性别='女 ' and 年龄>23 ( 3)查询至少选修了刘老师所讲授课程中的一门课程的女同学姓名 select s
姓名 from s,sc where s
性别='女 'and s
学号 and sc
课程编号 in (select c
课程编号 from c,t where c
教师编号=t
教师编号 and t
姓名='刘 %' ) ( 4)查询至少选修了2 门课程的学生学号 select sc
学号 from sc group by 学号 having count(课程编号)>2 ( 5)查询全部学生都选修的课程号与课程名 select c
课程编号,c
课程名称 from c,sc where sc
课程编号=c
课程编号 and sc
学号= (select distinct s
学号 from s ) (6)计算机系每个教师讲授的课程号 select t
教师编号,课程编号 from c,t where t
所在系='计算机系 ( 7)查询没有选修过任何一门课程的学生的学号 select s
学号 from s where s
学号 not in (select distinct sc
学号 from sc ) ( 10)统计个系教师的人数 select count (教师编号) from t group by 所在系 ( 11)统计出教师人数超过10 人的系的名称 select t
所在系 from t group by 所在系 having count(教师编号)>10 ( 12)在选课表SC 中查询成绩为NULL 的学生的