当前位置:网站首页>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
边栏推荐
- [CF 1425D]Danger of Mad Snakes(组合计数+容斥)
- 积性函数前缀和——杜教筛
- [2020WC Day2]F.采蘑菇的克拉莉丝(子树和查询、轻重儿子思想)
- [ACM-ICPC 2018 沈阳赛区网络预赛] J.Ka Chang (分块+dfs序)
- [牛客练习赛68]牛牛的粉丝(矩阵快速幂之循环矩阵优化)
- 技能点挖坑
- 学习笔记5-梯度爆炸和梯度消失(K折交叉验证)
- 可视化常见问题解决方案(八)数学公式
- 小程序wx.previewMedia相关问题解决-日常踩坑
- Emergency communication system for flood control and disaster relief
猜你喜欢

可视化常见绘图(五)散点图

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

学习笔记5-梯度爆炸和梯度消失(K折交叉验证)

数论分块(整除分块)

How to improve the service efficiency of the hotel without blind spots and long endurance | public and Private Integrated walkie talkie?

el-select 中v-model绑定值,数据回显只显示value,不显示label

可视化之路(十一)matplotlib颜色详解

Discussion on frame construction and technology selection of short video platform

Typora操作技巧说明(一).md

javscript获取文件真实后缀名
随机推荐
1.查看数据库和表
H5案例开发
反思 | 事件总线的局限性,组件化开发流程中通信机制的设计与实现
Applet newline character \ nfailure problem resolution - Daily pit stepping
技术小白的第一篇(表达自己)
5.SQL99标准:内连接和外连接
Meishe helps Baidu "Duka editing" to make knowledge creation easier
Solution of emergency communication system for major security incidents
页面动态显示时间(升级版)
el-date-picker中自定义快捷选项picker-options,动态设置禁用日期
Take you to travel in space, and American photography technology provides comprehensive technical support for aerospace creative applet
[2020WC Day2]F.采蘑菇的克拉莉丝(子树和查询、轻重儿子思想)
Typora语法详解(一)
Dirichlet 前缀和(数论优化式子复杂度利器)
[牛客练习赛68]牛牛的粉丝(矩阵快速幂之循环矩阵优化)
菜菜的并发编程笔记 |(五)线程安全问题以及Lock解决方案
el-table的数据更新后,页面中数据未更新this.$forceUpdate()无效果
学习笔记5-梯度爆炸和梯度消失(K折交叉验证)
可视化常见绘图(三)面积图
AuthorizationServer(授权服务器的简单搭建)