3、 查询全体学生及其出生年份
select Sname,2012-Sage from Student
如上可以看到出生年份没有列名,婴儿可改的查询代码为
select Sname,2012-Sage bir from Student
4、 查询选修了课程的学生的学号
select Sno from SC
5、 查询选修了课程的学生的学号,并去掉重复值
select distinct Sno from SC
6、 查询计算机系的全体学生的名单
select Sname from Student
where Sdept='计算机'
7、 查询所有年龄在22岁以下的学生姓名及其年龄
select Sname ,Sage from Student where Sage<22
8、 查询考试成绩在90分以上的学生的学号
select Sno from SC
where Greade>90
9、 查询年龄在20到22之间的学生姓名、系别和年龄
select Sname,Sdept,Sage from Student
where Sage between 20 and 22
10、查询年龄不在21到22 之间的学生姓名,系别和年龄
select Sname,Sdept,Sage from Student
where Sage not between 21 and 22