实验二
2、查询计算机系的学生学号、姓名、出生年份,按出生年份降序显示(给出生年份起个别名);
select sno,sname,2014-sage birthday
from student
where sdept=’cs’
order by sage desc;
4、查询选修了课程的学生学号;
select distinct sno
from sc
6、查询是计算机系或数学系的学生姓名,年龄;
select sname,sage
from student
where sdept in (‘cs’, ‘math’);
7、查询课程名含有‘’的全部信息;
selecet *
from course
where cname like ‘%系统%’;
8、查询学号倒数第二位是‘2’的学生姓名、院系;
select sname,sdept
from student
where sno like ‘%2_’;
9、对选课表记录按照学号升序、学号一样的按成绩降序进行排序;
select *
from sc
order by sno asc,grade desc;