资源描述:
《11-sql语句测试题3》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、以下各个题目将用到上图的4个表,其关联关系如图所示。这个四个表中字段的具体情况参看如下内容:EMPLOYEES(employee_idnumber(6)notnull,first_namevarchar2(20),last_namevarchar2(25)notnull,emailvarchar2(25)notnull,phone_numbervarchar2(20),hire_datedatenotnull,job_idvarchar2(10)notnull,salarynumber(8,2),commission_pctnumber(2,2),manager_idnumber(6),de
2、partment_idnumber(4))DEPT(department_idnumber(4)notnull,department_namevarchar2(30)notnull,manager_idnumber(6),location_idnumber(4))locations(location_idnumber(4)notnull,cityvarchar2(20))job_grades(grade_levelvarchar2(3),lowest_salnumber,highest_salnumber)1.EMPLOYEES(employee_id,first_name,last_nam
3、e,email,phone_number,hire_date,job_id,salary,commission_pct,manager_id,department_id)。job_grades(grade_level,lowest_sal,highest_sal)。显示JOB_GRADES表的结构。创建一个查询显示所有雇员的name、job、departmentname、salary和grade。1.EMPLOYEES(employee_id,first_name,last_name,email,phone_number,hire_date,job_id,salary,commission_
4、pct,manager_id,department_id)。创建一个查询显示那些在雇员Davies之后入本公司工作的雇员的name和hiredate。2.EMPLOYEES(employee_id,first_name,last_name,email,phone_number,hire_date,job_id,salary,commission_pct,manager_id,department_id)。显示所有雇员的names和hiredates,他们在他们的经理之前进入本公司,连同他们的经理的名字和受雇日期一起显示。列标签分别为Employee、EmpHired、Manager和MgrH
5、ired。3.EMPLOYEES(employee_id,first_name,last_name,email,phone_number,hire_date,job_id,salary,commission_pct,manager_id,department_id)。显示所有雇员的最高、最低、合计和平均薪水,列标签分别为:Maximum、Minimum、Sum和Average。四舍五入结果为最近的整数4.在4题基础上,显示每中工作类型的最低、最高、合计和平均薪水。5.EMPLOYEES(employee_id,first_name,last_name,email,phone_number,h
6、ire_date,job_id,salary,commission_pct,manager_id,department_id)。写一个查询显示每一工作岗位的人数。6.EMPLOYEES(employee_id,first_name,last_name,email,phone_number,hire_date,job_id,salary,commission_pct,manager_id,department_id)。确定经理人数,不需要列出他们,列标签是NumberofManagers。提示:用MANAGER_ID列决定经理号。1.EMPLOYEES(employee_id,first_na
7、me,last_name,email,phone_number,hire_date,job_id,salary,commission_pct,manager_id,department_id)。写一个查询显示最高和最低薪水之间的差。列标签是DIFFERENCE。2.EMPLOYEES(employee_id,first_name,last_name,email,phone_number,hire_date,j