数据库题目。。哎。。。。。
先谢谢了啊
------解决方案--------------------
第一部分的方案:
1)select top 3 * from employees
2)select * from employees e
where e.dept_id='003'
and emp_salary<2000
3)select * from employees e
left join
depatments s
on e.dept_id=s.dept_id
where emp_sex='男'
and dept_name='销售部门'
4)select avg(emp_salary) into tb1
from employees e
left join
depatments s
on e.dept_id=s.dept_id
where e.emp_sex='女'
and s.dept_name='销售部门'
5)insert into employees(emp_id,emp_name,emp_sex)
select '201254','李明','男'
6)update employees e set dept_id=(select dept_id
from depatments where dept_name='销售部门'
) where e.emp_name='赵雪'
7)delete from employees
where emp_name='赵雪'