首页 一套SQL笔试题

一套SQL笔试题

举报
开通vip

一套SQL笔试题一套SQL笔试题fromemployees4、显示所有雇员的姓名、工资并将DEPARTMENT」。显不为(Department_ld)oselectDepartment_ldfromlast_name,salary,DEPARTMENT_IDasemployees5、查找在60号部门工作的雇员。selectlast_name+first_namename,department_idfromemployeeswheredepartmet_id二606要求查找职位为SHCLERK和SAMAN的雇员姓名(last_nam...

一套SQL笔试题
一套SQL笔试题fromemployees4、显示所有雇员的姓名、工资并将DEPARTMENT」。显不为(Department_ld)oselectDepartment_ldfromlast_name,salary,DEPARTMENT_IDasemployees5、查找在60号部门工作的雇员。selectlast_name+first_namename,department_idfromemployeeswheredepartmet_id二606要求查找职位为SHCLERK和SAMAN的雇员姓名(last_name)oselectlast_namejob_idfromemployeeswherejob_idin('shclerk',saman‘)7、查找职位不是SH_CLERK和SA_MAN的雇员工种及姓名。将姓名显示为(first_name+last_name命名为"Name”)oselectfirst_name+last_nameName,job_idfromemp1oyeeswherejob_idnotin(sh_clerk,,sa_manJ)8>查找哪些雇员的工资在2000到3000之间select*fromemployeeswheresalarybetween2000and30009>找哪些雇员的工资不在3000到5000之间select*fromemployeeswheresalarynotbetween3000and500010>查找firstname以D开头,后面仅有三个字母的雇员信恩。select*fromemployeeswherefirst_namelikefirst_namenotliked_'11、查找last__name以K开头的雇员息。selectlast_name,first_name,department_idfromemployeeswherelast_namelikek%12、查找名字以字母M开头,尾,并且第三个字母为C的雇员名字(First_name)>工种和所在部门selectfirst_name,job_id,department_idfromemployeeswherefirst_namelikeS3%‘14、查找没有奖金的雇员信息。m_c%l13>查找哪些雇员的工种名不以SA开头。selectjob_idfromemployeeswherejob_idnotlikeselect*fromemployeeswherecommission_pctisnulll5>查找有奖金的雇员信息。select*fromemployeeswherecommission_pctisnotnulll6>查找30号部门里不是CLERK的雇员信息。select*fromemployeeswheredepartme址」*30andjob_idnotlike%clerk%17、查找在30号部门工作或不是CLERK的雇员信息。select*fromemployeeswheredepartment_id=30orjob_idnotlike'%clerk%'查找60号部门且工资大于5000的员工的信息select*fromemployeeswheredepartment_id二60andsalary>500018>按字母顺序显示雇员的名字(last_name)。selectlast_namefromemployeesorderbylast_name19、按部门号降序显不。select*fromemployeesorderbydepartment_iddesc20select*from查找工资高于$2000的雇员信息,按部门号和雇员名字排序。employeeswheresalary>2000orderbydepartment_id,employee_id21、选择奖金咼5%的雇员信息SELECTFIRST_NAME,LAST_NAME,COMMISSION_PCTFROMdbo.EMPLOYEESWHERE(COMMISSION_PCT>.05)22查询年工资高于50000的员工信息select*fromemployeeswhere12*salary>5000023查询奖金咼于5000的员工姓名dayl>查出部门地区编号为1700的员工姓名selectfirst_name,last_name,city,department・1ocation」dfromlocations,employees,departmentwherelocations」ocation_id二department・location_idand、查询工作地区为北京的员工名及工selectlocations.location_id二17002资信first_name,last_name,salary,commission_pct,cityfromlocations,employees,departmentswheredepartments.location」d=locations.location」danddepartments.department_id二employees,department_idand、查询薪水标准为B类的员工名departments.location_id二17003称和员工薪水以及工资类别名称selectlast_name,firstname,salary,commission_pct,grafromdepartmentsd,employeese,job_gradesjwheree.salarybetweenj」owestandj.highestandj.gra='b'andd.department_id―.e.department_id4、查询出主管Raphael5^管理的员工和薪水信恩selectaJ&st_name+a.first_nameasname,a.salary,a.commission_pct,b」ast_namefromemployeesa,employeesbwherea.department_id―.b.department_idanda.last_namelike%raphaely%'5、查出雇员所在的部门,并将没有雇员的部门的记录也显示岀来selecteastname+e.firstname—1—asname,d.department_idfrom(e.department_id—.d.departmedepartmentsdleftouterjoinemployeeseonnt_id)6工{s恩select、查询岀没有分配部门的员e.last_name+e.first_nameasname,e.department_idfromdepartmentsdleftouterjoinemployeeseon(e.department_id―.d.department_id)whered.department_idisnull7>计算每个部门的平均工资和工资总和selectdepartment_id,sum(salary)sum,avg(salary)avgfromemployeesgroupbydepartment_id8、查询每个部门的每个工种的雇员数selectcount(*)num,department_id,job_idfromemployeesgroupbydepartment_id,job_id9、请算岀employee表中总雇员数量selectcount(*)fromemployeelO.请算出employee表中所有雇员的平均工资selectavg(salary)fromemployee".请查询出employee表中的最低工资selectmin(salary)fromemployeel2•请查询岀employee表中最高工资selectmax(salary)fromemployeel3、请计算出每个部门的平均工资、最咼工资和最低工资selectmax(salary)max,min(salary)min,avg(salary)avg,department_idfromemployeegroupbydepartment_idl4、查询按部门名称分组工资总和大于4200的部门名称、工资禾口selectdepartmentname,sum(salary)frome,departmentsdwheree.department_id—.d.department_idgroupbydepartment_namehavingsum(salary)>4200test0011•请查询岀employee表中最低工资的雇员selectlast_namefromemployeewheresalary31(selectmin(salary)fromemployee)2.请查询出employee表中最咼工资的雇员selectlast_namefromemployeewheresalary二(selectmax(salary)fromemployee)3查询工资咼于105号雇员的last__name,并且工种与他相同的雇员情况。selectlast_name,job_id,salaryfromemployeeswheresalary>(selectsalaryfromemployeeswhereemployee_id=z,105')andjob_id=(selectjob_idfromemployeeswhereemployee_id二'105)4、查询工资咼于或等于30号部门工资最咼额的雇员。selectlast_name,salaryfromemployeeswhere查询工资salar5^>=(selectmax(salary)fromemployeeswheredepartment_id二30)5在1000到5000之间的雇员所在部门的所有人员的{s恩。select*fromemployeeswheredepartment_idin(selectdepartment_idfromemployeeswheresalarybetween1000and5000)6食扌戈工资咼于60号部门所有员工的人员信息。显示其员工编号,last_name和工资。selectlast_name,employee_id,salaryfromemployeeswheresalary〉(selectmax(salary)fromemployeeswheredepartment_id二60)7将114号雇员的工种和部门号改为102号雇员的工种和部门号。8、将所有与106号雇员相同工种的职工的部门号改成106号雇员所在的部门。9、查询工种不为SH.CLERK,并且工资小于其中任何一个SH_CLERK的雇员信息。
本文档为【一套SQL笔试题】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
该文档来自用户分享,如有侵权行为请发邮件ishare@vip.sina.com联系网站客服,我们会及时删除。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。
本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。
网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
下载需要: 免费 已有0 人下载
最新资料
资料动态
专题动态
is_704284
暂无简介~
格式:doc
大小:18KB
软件:Word
页数:0
分类:
上传时间:2018-07-18
浏览量:3