一、查询没有奖金,且工资小于18000的salary,last_name
select salary,last_namefrom employeeswhere commission_pct is null and salary<18000;
二、查询employees表中,job_id不为’IT’或者工资为12000的员工信息
select *from employeeswhere not job_id='IT'or salary=12000;
三、查看部门departments表的结构
desc departments;
四、查询部门departments表中涉及到了哪些位置编号
select distinct location_idfrom departments;
五、经典面试题:
试问:select from employees和select from employees where commission_pct like ‘%%’ and last_name like ‘%%’;结果是否一样?并说明原因
不一样,如果判断的字段有null值就不一样,like’%%’不包含null
