select * from StudentInfo;
select * from TeacherInfo;
select * from StudentExam;
练习二:单行函数练习
1、查询所有学员从入学到今天,一共度过了多少天
select months_between(sysdate,stuJoinTime)*31 from StudentInfo;
2、查询每月2号入学的学员信息
select * from StudentInfo where extract(day from stuJoinTime)=2;
3、查询所有学员的毕业日期,假定按每个学员入学时间1年半之后将毕业。
select stuJoinTime,add_months(stuJoinTime,18) from studentinfo;
4、查询星期四入学的学员姓名,性别,年龄,班级编号
select * from StudentInfo where to_char(stuJoinTime,'d')=5;
select * from studentinfo where to_char(stuJoinTime,'day')='星期四';
5、查询‘2007-3-10’之前入学的学员信息
select * from StudentInfo where stuJoinTime<to_date('2007-3-10','yyyy-mm-dd');
6、查询所有学员姓名的长度
select length(stuName) from StudentInfo;
7、查询身份证中第9,10位为‘89’的学员信息(要求使用字符串函数)
select * from StudentInfo where substr(stuCard,9,
select * from TeacherInfo;
select * from StudentExam;
练习二:单行函数练习
1、查询所有学员从入学到今天,一共度过了多少天
select months_between(sysdate,stuJoinTime)*31 from StudentInfo;
2、查询每月2号入学的学员信息
select * from StudentInfo where extract(day from stuJoinTime)=2;
3、查询所有学员的毕业日期,假定按每个学员入学时间1年半之后将毕业。
select stuJoinTime,add_months(stuJoinTime,18) from studentinfo;
4、查询星期四入学的学员姓名,性别,年龄,班级编号
select * from StudentInfo where to_char(stuJoinTime,'d')=5;
select * from studentinfo where to_char(stuJoinTime,'day')='星期四';
5、查询‘2007-3-10’之前入学的学员信息
select * from StudentInfo where stuJoinTime<to_date('2007-3-10','yyyy-mm-dd');
6、查询所有学员姓名的长度
select length(stuName) from StudentInfo;
7、查询身份证中第9,10位为‘89’的学员信息(要求使用字符串函数)
select * from StudentInfo where substr(stuCard,9,