当前位置:网站首页>2. Restricted query
2. Restricted query
2022-04-23 07:40:00 【Ah Dai cloth clothes cool】
2. Limited query
1. Query salary greater than 1500 Of employees
select * from emp
where sal>1500;
2. Query employee number is not 7369 Of employees
select * from emp
where empno!=7369;
3. The search name is smith Your employee number 、 full name 、 Wages 、 Entry time
select empno,ename,sal,hiredate
from emp
where ename='smith';
4. Query employee information without bonus
select * from emp
where comm is null;
5. Query basic salary greater than 1000, The name of the employee who can get the bonus 、 Wages 、 Bonus
select ename,sal,comm from emp
where sal>1000 and comm is not null;
6. Inquiry engaged in sales , Or pay more than or equal to 2000 Of employees
select * from emp
where job='saleman' or sal>=2000;
7. Inquiry engaged in sales , And the salary is not less than 1500 Employee's number 、 full name 、 Position 、 Wages 、 Entry time
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. Query basic salary greater than 1500, But less than 3000 Of employees
select * from emp
where sal>1500 and sal<3000;
select * from emp
where sal between 1500 and 3000;
9. Inquire about 1981 Employee number of the year of employment 、 full name 、 Entry time 、 Department number
select empno,ename,hiredate,deptno
from emp
where hiredate between '1981-1-1' and '1981-12-31';
10. The query number is 7369、7499、7788 Of employees
select * from emp
where empno=7369 or empno=7499 or empno=7788;
select * from emp
where empno in (7369,7499,7788);
11. Query name is smith、allen、king Your employee number 、 full name 、 Entry time
select empno,ename,hiredate
from emp
where ename in ('smith','allen','king');
12. Query employee name to S Employee information at the beginning
select * from emp
where ename like 'S%';
13. The query employee name contains M Of employees
select * from emp
where ename like '%M%';
14. Inquiry engaged in sales , And the length of the name is 4 Character employee information
select * from emp
where job='saleman' and ename like '____';
15. Inquire about 1981 Employee number of the year of employment 、 full name 、 Entry time 、 Department number
select empno,ename,hiredate,deptno
from emp
where hiredate like '1981%';
版权声明
本文为[Ah Dai cloth clothes cool]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230622239532.html
边栏推荐
- Reflection on the systematic design of Android audio and video caching mechanism
- 5.SQL99标准:内连接和外连接
- Machine vision series (01) -- Overview
- 什么是闭包?
- 可视化常见绘图(一)堆叠图
- [LNOI2014]LCA——树链剖分——多点LCA深度和问题
- 菜菜的刷题日记 | 蓝桥杯 — 十六进制转八进制(纯手撕版)附进制转换笔记
- Applet Wx Previewmedia related problem solving - Daily stepping on the pit
- 1. View databases and tables
- [CodeForces - 208E] Blood Cousins(k代兄弟问题)
猜你喜欢
随机推荐
Moment.js中format方法函数的格式
Lead the industry trend with intelligent production! American camera intelligent video production platform unveiled at 2021 world Ultra HD Video Industry Development Conference
反思 | 事件总线的局限性,组件化开发流程中通信机制的设计与实现
安装tui-editor失败,快速解决方案
Mysql 索引
可视化常见绘图(三)面积图
技能点挖坑
可视化常见问题解决方案(九)背景颜色问题
14.事务处理
反思|开启B站少女心模式,探究APP换肤机制的设计与实现
[Educational Codeforces Round 80] 解题报告
保洁阿姨都能看懂的中国剩余定理和扩展中国剩余定理
redis连接出错 ERR AUTH <password> called without any password configured for the default user.
海康威视面经总结
Mysql 数据库从设计上的优化
# 可视化常见绘图(二)折线图
6.聚合函数和分组统计
反思 | Android 音视频缓存机制的系统性设计
What is a closure?
On BFC (block formatting context)









