数据库集合(oracle sql)查询语句

数据库集合(oracle sql)查询语句

ID:15480677

大小:58.00 KB

页数:20页

时间:2018-08-03

数据库集合(oracle sql)查询语句_第1页
数据库集合(oracle sql)查询语句_第2页
数据库集合(oracle sql)查询语句_第3页
数据库集合(oracle sql)查询语句_第4页
数据库集合(oracle sql)查询语句_第5页
资源描述:

《数据库集合(oracle sql)查询语句》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库

1、数据库集合(oraclesql)查询语句oracle1.select*fromemp;2.selectempno,ename,jobfromemp;3.selectempno编号,ename姓名,job工作fromemp;4.selectjobfromemp;5.selectdistinctjobfromemp;6.selectdistinctempno,jobfromemp;说明:因为雇员编号不重复,所以此时证明所有的列没有重复,所以不能消除掉重复的列.7.查询出雇员的编号,姓名,工作,但是显示的格式:编号是:7369的雇员,姓

2、名是:smith,工作是:clearselect'编号是:'

3、

4、empno

5、

6、'的雇员,姓名是:'

7、

8、ename

9、

10、',工作是:'

11、

12、jobfromemp;8.求出每个雇员的姓名及年薪selectename,sal*12incomefromemp;9.求出工资大于1500的所有雇员信息select*fromempwheresal>1500;10.查询每月可以得到奖金的雇员信息select*fromempwherecommisnotnull;11.查询没有奖金的雇员信息select*fromempwherecommisnull;12

13、.查询出基本工资大于1500同时可以领取奖金的雇员信息select*fromempwheresal>1500andcommisnotnull;13.查询出基本工资大于1500或者可以领取奖金的雇员信息select*fromempwheresal>1500orcommisnotnull;14.查询出基本工资不大于1500或者不可以领取奖金的雇员信息select*fromempwherenot(sal>1500andcommisnotnull);15.查询基本工资大于1500,但是小于3000的全部雇员信息select*fromemp

14、wheresal>1500andsal<3000;16.查询基本工资大于等于1500,但是小于等于3000的全部雇员信息select*fromempwheresal>=1500andsal<=3000;select*fromempwheresalbetween1500and3000;17.查询出在1981年雇佣的全部雇员信息(1981年1月1日到1981年12月31日之间的雇佣的雇员)select*fromempwherehiredatebetween'1-1月-81'and'31-12月-81';18.要求查询出姓名是smith

15、的雇员信息select*fromempwhereename='SMITH';19.要求查询出雇员是7369,7499,7521的雇员的具体信息select*fromempwhereempno=7369orempno=7499orempno=7521;select*fromempwhereempnoin(7369,7499,7521);20.要求查询出雇员不是7369,7499,7521的雇员的具体信息select*fromempwhereempnonotin(7369,7499,7521);21.要求查询出姓名是smith,all

16、en,king的雇员信息select*fromempwhereenamein('SMITH','ALLEN','KING');22.查询出所有雇员姓名中第二个字母包含"M"的雇员信息select*fromempwhereenamelike'_M%';23.查询出雇员姓名中包含字母M的雇员信息select*fromempwhereenamelike'%M%';24.要求查询出在1981年雇佣的雇员信息select*fromempwherehiredatelike'%81%';25.查询工资中包含5的雇员信息select*fromem

17、pwheresallike'%5%';26.查询雇员编号不是7369的雇员信息select*fromempwhereempno!=7369;select*fromempwhereempno<>7369;27.要求按照工资由低到高排序select*frmemporderbysal;select*fromemporderbysalasc;28.要求按照工资由高到低排序select*fromemporderbysaldesc;29.要求查询出20部门的所有雇员信息,查询的信息按照工资由高到低排序,如果工资相等,则按照雇佣日期由早到晚排序

18、.select*fromempwheredeptno=20orderbysaldesc,hiredateasc;30.将小写字母变为大写字母selectupper('hello')fromdual;31.将大写字母变为小写字母selectlower

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。