练习二:基本查询与操作符
1、查询所有学员信息
select * from StudentInfo;
2、查询所有学员的姓名,年龄(要求列名用中文显示)
select stuName 姓名,stuAge 年龄 from StudentInfo;
3、查询学员的年龄共有哪几种值(要求不计算重复项)
select distinct stuAge from StudentInfo;
4、查询所有女性学员的信息
select * from StudentInfo where stuSex='女';
5、查询前三个学员的信息(要求使用rownum)
select * from StudentInfo where rownum<=3;
6、查询学员信息,要求显示效果如下:
select '姓名'||stuName||',年龄'||stuAge||',家住'||stuAddress 学员信息 from StudentInfo;
7、查询年龄小于20岁,家住长沙的男性学员信息
select * from StudentInfo where stuSex='男' and stuAge<20 and stuAddress like '%长沙%';
8、查询年龄在16-18岁(包括16,18岁)的学员信息
select * from StudentInfo where stuAge between 16 and 18;
9、查询身份证中包含有‘1989’字符的学员信息
select * from StudentInfo where stuCard like '%1989%';
10、查询‘2007-3-
1、查询所有学员信息
select * from StudentInfo;
2、查询所有学员的姓名,年龄(要求列名用中文显示)
select stuName 姓名,stuAge 年龄 from StudentInfo;
3、查询学员的年龄共有哪几种值(要求不计算重复项)
select distinct stuAge from StudentInfo;
4、查询所有女性学员的信息
select * from StudentInfo where stuSex='女';
5、查询前三个学员的信息(要求使用rownum)
select * from StudentInfo where rownum<=3;
6、查询学员信息,要求显示效果如下:
select '姓名'||stuName||',年龄'||stuAge||',家住'||stuAddress 学员信息 from StudentInfo;
7、查询年龄小于20岁,家住长沙的男性学员信息
select * from StudentInfo where stuSex='男' and stuAge<20 and stuAddress like '%长沙%';
8、查询年龄在16-18岁(包括16,18岁)的学员信息
select * from StudentInfo where stuAge between 16 and 18;
9、查询身份证中包含有‘1989’字符的学员信息
select * from StudentInfo where stuCard like '%1989%';
10、查询‘2007-3-