##比较 <>,!<,!>
##范围 (not) between 低 and 高
##集合 (not) in
##字符 (not) like
##空值 is (not) null
##多条件 and or not
##排序 order by 字段名 [desc降序]
##数量 limit n offset m (n=-1,表示最后一行数据)
##别名 1数据表 别名 2字段名 as 别名
#1查找最晚入职员工的所有信息
select *
from employees
order by hire_date desc
limit 1
#2查找入职员工时间排名倒数第三的员工所有信息
select *
from employees
order by hire_date desc
limit 1 offset 2
#3查找当前薪水详情以及部门编号dept_no
select a.emp_no, a.salary, a.from_date, a.to_date, b.dept_no
from salaries a
left join dept_manager b
on a.emp_no=b.emp_no
where a.to_date='9999-01-01' and b.to_date='9999-01-01'