SELECT last_name,salary
FROM employees
WHERE salary <5000OR salary >12000;SELECT last_name,salary
FROM employees
WHERENOTBETWEEN5000AND12000;
2.选择在20或50号部门工作的员工姓名和部门号
SELECT last_name,department_id
FROM employees
WHERE department_id =20OR department_id =50;SELECT last_name,department_id
FROM employees
WHERE department_id IN(20,50);
3.选择公司中没有管理者的员工姓名及job_id
SELECT last_name,job_id
FROM employees
WHERE manager_id <=>NULL;SELECT last_name,job_id
FROM employees
WHERE manager_id ISNULL;
4.选择公司中有奖金的员工姓名,工资和奖金级别
SELECT last_name,salary,commission_pct
FROM employees
WHERE commission_pct ISNOTNULL;
5.选择员工姓名的第三个字母是a的员工姓名
SELECT last_name
FROM employees
WHERE last_name
LIKE'__a%';
6.选择姓名中有字母a和k的员工姓名
SELECT last_name
FROM employees
WHERE last_name LIKE'%a%k%'OR last_name LIKE'%k%a%';
7.显示出表 employees 表中 first_name 以 'e’结尾的员工信息
SELECT employee_id,first_name,last_name
FROM employees
WHERE first_name LIKE'%e';
8.显示出表 employees 部门编号在 80-100 之间的姓名、工种
SELECT last_name,job_id
FROM employees
WHERE department_id IN(80,100);SELECT last_name,job_id
FROM employees
WHERE department_id BETWEEN80AND100;
SELECT last_name,salary,manager_id
FROM employees
WHERE manager_id =100OR manager_id =101OR manager_id =110;SELECT last_name,salary,manager_id
FROM employees
WHERE manager_id IN(100,101,110);