当前位置:网站首页>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
边栏推荐
猜你喜欢
随机推荐
6.聚合函数和分组统计
Failed to install Tui editor, quick solution
学习笔记7-深度神经网络优化
7.子查询
常用的DOS命令
Meishe helps Baidu "Duka editing" to make knowledge creation easier
可视化常见绘图(三)面积图
manjaro安装与配置(vscode,微信,美化,输入法)
What is a closure?
Moment.js中format方法函数的格式
Applet newline character \ nfailure problem resolution - Daily pit stepping
Object. Create() principle, object Create() specification, handwritten object create(),Object. Create() usage
null和undefined的区别
数据分析学习(一)数据分析和Numpy基础
[hdu6833]A Very Easy Math Problem(莫比乌斯反演)
npm 安装踩坑
12.约束
【自我激励系列】到底是什么真正阻碍了你?
Background management system framework, there is always what you want
Mysql的存储引擎