#一、查询没有奖金,且工资小于18000 salary,last_name 并排序。
SELECT salary,last_name
FROM employees
WHERE commission_pct IS NULL
AND salary<18000
ORDER BY salary DESC;
#二、查询employess表中,job_id不为‘IT’,或者工资为12000的员工信息
#WHERE job_id <>IT
SELECT *
FROM employees
WHERE job_id NOT IN ('IT')
OR salary=12000;
/*三、经典面试题
试问:SELECT * FROM empoyees; 和
SELRCT * FROM empoyees
WHERE commission_pct
LIKE ‘%%’
AND last_name LIKE ’%%‘;
结果是否一样?并说明理由。
不一样
如果判断的字段有null值
and 换成 or就行了
*/