首页 > 代码库 > 补上15的
补上15的
今晚断网了 所以只能现在这里先记着了,为期13天的第一阶段(杨洪波老师) 基础加强 ,和ADO.net结束了,在这里谢谢小杨老师,虽然不能说小杨老师课讲的透彻,但是,这也是我目前为止觉得还行的老师,其实,每个人都是老师领进门,修行靠个人了 现在我才发现平时少敲代码是最大的短板 还有基础很不扎实 这都需要自己下狠功夫去补,虽然有点后悔以前的的浪费时间,但是也庆幸自己现在发现了。虽然苦点,累点,但是我觉得自己造成后果,只能用自己几倍的努力去弥补!
--1.列出EMPLOYEES表中各部门的:部门编号,最高工资,最低工资
select department_id 部门编号,max(salary) 最高工资,min(salary) 最低工资 from employees group by department_idselect * from departments
--2.列出EMPLOYEES表中各部门的:部门编号、部门名称、最高工资、最低工资
select Employees.Department_Id 部门编号,Department_Name 部门名称,MAX(Salary) 最高工资,MIN(Salary) 最低工资 from Departments inner join Employees on Departments.Department_ID=Employees.Department_Id group by Department_Name,Employees.Department_Id
select * from dbo.Departments
--3.列出EMPLOYEES表中各部门中‘职员‘(Employee_job为‘职员‘)的:最低工资,最高工资和部门Idselect department_id 部门ID, max(salary) 最高工资,min(salary) 最低工资 from employees where employee_job=‘职员‘ group by department_id
select * from dbo.Employees
4.对于EMPLOYEES中最低工资小于1000的部门,列出EMPLOYEE_JOB为‘职员‘的:部门编号,最低工资,最高工资select department_id 部门ID,max(salary) 最高工资,min(salary) 最低工资,employee_job from employees where Employee_Job=‘职员‘ group by department_id,Employee_Job having min(salary)<10005.根据部门编号由高到低,工资由低到高,列出每个员工的姓名,部门号,工资select employee_name 员工名,department_id 部门编号,salary 工资 from dbo.Employees order by Department_Id desc,salary asc--6.列出‘吴用‘所在部门中每个员工的姓名与部门号select * from dbo.Employeesselect employee_name,department_id from Employees where department_id in(select department_id from employees where employee_name=‘吴用‘)select * from dbo.Departments--7.列出每个员工的姓名,头衔,部门号,部门名select Employees.employee_name,Employees.employee_job,Employees.Department_Id,Departments.department_name from employees inner join departments on Employees.department_id=Departments.Department_Id--8.列出EMPLOYEES中头衔为‘职员‘的员工的姓名,工作,部门号,部门名select * from dbo.Employeesselect * from dbo.Departmentsselect employees.employee_name,employees.employee_job,employees.Department_Id,departments.department_name from employees inner join departments on employees.Department_Id=departments.Department_Id where employees.employee_job=‘职员‘--9.对于DEPARTMENTS表中,列出所有:部门名称,部门编号,以及该部门的:员工姓名与头衔select Departments.department_id,Departments.department_name, Employees.employee_job,Employees.employee_name from Departments left join Employees on Employees.department_id=Departments.Department_Id
唉。。。。。。无言以对-------今天有点伤感 所以就到这里 努力再努力!
补上15的