资源描述:
《oracle查询入门练习(oracle query entry to practice)》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、oracle查询入门练习(Oraclequeryentrytopractice)OraclequeryentrytopracticePracticeforSCOTTOracle============queryfunctionandpartof==============Thefirstpart:1,theuseofbasicquery.(1)DEPTquerytableshowsallthenameoftheDepartment.(2)EMPquerytableshowsallemployeesandtheannualinco
2、me(monthlysalary=salary+allowance),NULL,andspecifythecolumnalias"annualincome".(NVL(comm,0)commnullvaluewith0alternative)(3)querydoesnotexistinalldepartments,employees.2,limitthequerydata(1)EMPquerytableshowsmorethan2850ofthewagesoftheemployeenameandsalary.(2)EMPquer
3、ytableshowsthesalaryin1500~2850betweenallemployeesandwages.(3)EMPquerytableshowsthecodefortheemployee'snameanddepartmentcode7566.(4)EMPquerytableshowsemployeesandwagesector10and30morethan1500ofthewages.(5)EMPquerytableshowsallemployeessecondcharacters"A"inthenameofth
4、eirwages.(6)EMPquerytableshowsgrantsnonemptyallemployeesandsubsidies.3,sortingdata(1)EMPquerytableshowsallemployeesname,salary,dateofemployment,andsortedinascendingorderoftheemployeename.(2)EMPquerytableshowsMay1,1981toemployees,jobsandemploymentdatesinFebruary1,1981
5、,andsortedtodateofemployment.(3)EMPquerytableshowsthebenefitofallemployees,wagesandbenefits,andtowagesubsidiesascendinganddescendingorder.Thesecondpart:Thereareatleast1.listsalldepartmentsofanemployee.2.alistofalltheemployees'salariesmorethan"SMITH".3.listthenamesofa
6、llemployeesandtheirnames.4.listthedateofentryofallemployeesearlierthantheirdirectsuperiors.5.listthenameoftheDepartmentandtheseemployees,theDepartmentemployeelistatthesametime.Alistofall6."CLERK"(clerk)thenameandthenameofthedepartment.7.listsavarietyofpositionsthemin
7、imumsalary,andshowstheminimumsalaryofmorethan1500ofalljobsandtheminimumwage.8.listedin"SALES"(Sales)theemployee'sname,thatdonotknowthesalesdepartmentDepartmentnumber.9.listedcompaniesofallemployeessalariesarehigherthantheaverage.All10.employeesarelistedwiththe"SCOTT"
8、inthesamejobs.11.listedsalaryequalinalldepartmentsofthe30employeesworksalaryemployeenameandsalary.12.listsinalldepartmentemployeess