当前位置:网站首页>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
边栏推荐
猜你喜欢

菜菜的并发编程笔记 |(九)异步IO实现并发爬虫加速

Solution of emergency communication system for major security incidents

Typora语法详解(一)

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

可视化常见绘图(三)面积图

数据分析入门 | kaggle泰坦尼克任务(三)—>探索数据分析

Tensorflow安装后ImportError: DLL load failed: 找不到指定的模块,且国内安装缓慢

Lead the industry trend with intelligent production! American camera intelligent video production platform unveiled at 2021 world Ultra HD Video Industry Development Conference

H5案例开发

可视化常见问题解决方案(八)共享绘图区域问题解决方案
随机推荐
可视化常见问题解决方案(七)画图刻度设置解决方案
[ACM-ICPC 2018 沈阳赛区网络预赛] J.Ka Chang (分块+dfs序)
pytorch:关于GradReverseLayer实现的一个坑
技能点挖坑
技术小白的第一篇(表达自己)
VIM使用
Patrol inspection intercom communication system in power industry
Us photo cloud editing helps BiliBili upgrade its experience
UDP基础学习
5.SQL99标准:内连接和外连接
(扩展)BSGS与高次同余方程
关于素数的不到100个秘密
Typora操作技巧说明(一)
可视化常见绘图(四)柱状图
莫比乌斯反演
F-牛妹的苹果树(直径合并)
Statement of American photography technology suing Tianmu media for using volcanic engine infringement code
kaggle-房价预测实战
7.子查询
Tensorflow安装后ImportError: DLL load failed: 找不到指定的模块,且国内安装缓慢