当前位置:网站首页>2.限定查询
2.限定查询
2022-04-23 06:23:00 【阿呆布衣酷】
2.限定查询
1.查询工资大于1500的雇员信息
select * from emp
where sal>1500;
2.查询雇员编号不是7369的雇员信息
select * from emp
where empno!=7369;
3.查询姓名是smith的雇员编号、姓名、工资、入职时间
select empno,ename,sal,hiredate
from emp
where ename='smith';
4.查询没有奖金的雇员信息
select * from emp
where comm is null;
5.查询基本工资大于1000,并且可以获取奖金的雇员姓名、工资、奖金
select ename,sal,comm from emp
where sal>1000 and comm is not null;
6.查询从事销售工作,或工资大于等于2000的雇员信息
select * from emp
where job='saleman' or sal>=2000;
7.查询从事销售工作,并且工资不小于1500的雇员的编号、姓名、职位、工资、入职时间
select empno,ename,job,sal,hiredate
from emp
where job!='saleman' and sal>=1500;
select empno,ename,job,sal,hiredate
from emp
where (not job='saleman') and (not sal<1500);
8.查询基本工资大于1500,但小于3000的雇员信息
select * from emp
where sal>1500 and sal<3000;
select * from emp
where sal between 1500 and 3000;
9.查询1981年入职的雇员编号、姓名、入职时间、所在部门编号
select empno,ename,hiredate,deptno
from emp
where hiredate between '1981-1-1' and '1981-12-31';
10.查询编号为7369、7499、7788的雇员信息
select * from emp
where empno=7369 or empno=7499 or empno=7788;
select * from emp
where empno in (7369,7499,7788);
11.查询姓名为smith、allen、king的雇员编号、姓名、入职时间
select empno,ename,hiredate
from emp
where ename in ('smith','allen','king');
12.查询雇员姓名以S开头的雇员信息
select * from emp
where ename like 'S%';
13.查询雇员姓名中包含M的雇员信息
select * from emp
where ename like '%M%';
14.查询从事销售工作,并且姓名长度为4个字符的雇员信息
select * from emp
where job='saleman' and ename like '____';
15.查询1981年入职的雇员编号、姓名、入职时间、所在部门编号
select empno,ename,hiredate,deptno
from emp
where hiredate like '1981%';
版权声明
本文为[阿呆布衣酷]所创,转载请带上原文链接,感谢
https://adbycool.blog.csdn.net/article/details/124341801
边栏推荐
- 组合数求解与(扩展)卢卡斯定理
- 页面动态显示时间(升级版)
- Wireless communication system for large-scale sports events
- Typora语法详解(一)
- Us photo cloud editing helps BiliBili upgrade its experience
- LATEX公式注意事项
- 1.查看数据库和表
- The difference between null and undefined
- 数据分析学习(一)数据分析和Numpy基础
- Beifeng communication helps Zhanjiang fire brigade build PDT wireless communication system
猜你喜欢

可视化常见绘图(四)柱状图

Flexible blind patch of ad hoc network | Beifeng oil and gas field survey solution

页面动态显示时间(升级版)

How does the public and Private Integrated walkie talkie realize cooperative work under multi-mode communication?

Discussion on arrow function of ES6

记录一些npm 有关的问题(杂乱记录)

pytorch:关于GradReverseLayer实现的一个坑

manjaro安装与配置(vscode,微信,美化,输入法)

配置npm

USO technology was invited to share the technical framework and challenges of AI synthetic virtual characters at lvson2020 conference
随机推荐
1D/1D动态规划学习总结
青龙面板拉库命令更新【2022/4/20】收藏不走丢
colab
可视化之路(十二)Collection类详解
Discussion on frame construction and technology selection of short video platform
van-uploader上传图片实现过程、使用原生input实现上传图片
AuthorizationServer(授权服务器的简单搭建)
[hdu6833]A Very Easy Math Problem(莫比乌斯反演)
使用el-popconfirm和el-backtop不生效
反思 | 事件总线的局限性,组件化开发流程中通信机制的设计与实现
How to improve the service efficiency of the hotel without blind spots and long endurance | public and Private Integrated walkie talkie?
11.表和库的管理
如何SQL 语句UNION实现当一个表中的一列内容为空时则取另一个表的另一列
Applet newline character \ nfailure problem resolution - Daily pit stepping
F-牛妹的苹果树(直径合并)
[牛客挑战赛47]C.条件 (bitset加速floyd)
安装tui-editor失败,快速解决方案
可视化常见问题解决方案(八)数学公式
如何将进程绑定到指定的CPU上
Source Insight 4.0常见问题