oracle考試重點復習題及答案_第1頁
oracle考試重點復習題及答案_第2頁
oracle考試重點復習題及答案_第3頁
oracle考試重點復習題及答案_第4頁
oracle考試重點復習題及答案_第5頁
已閱讀5頁,還剩3頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)

文檔簡介

1.顯示該模式下的所有表名,在USER_TABLES.descUSER_TABLES;SELECTtable_namefromuser_tables;2.查看每個表的列名、列類型、非空等約束。

DESC表名;3.顯示所有名字(last_name)以G開頭且工資(salary)大于3000的人的姓名、工資、部門編號

selectlast_name姓名,salary工資,department_id部門編號fromemployeeswherelast_namelike‘G%’andsalary>3000;4.顯示所有名字(last_name)以G開頭且工資(salary)大于3000的人的姓名、工資、部門名稱selecte.last_name姓名,e.salary工資,d.department_name部門名稱

fromemployeese,departmentsdwherelast_namelike'G%’andsalary>=3000and.department_id=d.department_id;5.顯示工作簡歷表(job_history)中所有人的姓名、當時的部門編號和工作編號(job_id)selecte.last_name,j.department_id,j.job_idfromemployeese,job_historyjwheree.employee_id=j.employee_id;6.顯示工作簡歷表中所有人的姓名、工作名稱和部門名稱。

(employees,jobs,job_history,departments)selecte.last_name,d.department_name,jj.job_titlefromemployeese,job_historyj,jobsjj,departmentsdwheree.employee_id=j.employee_idandj.department_id=d.department_idandj.job_id=jj.job_id7.顯示每個工作編號(job_id)上的工作人數(shù)。

selectjob_id,count(*)fromemployeesgroupbyjob_id8.顯示所有工資不小于平均工資的人姓名、工資

selectlast_name,salaryfromemployeeswheresalary>=(selectavg(salary)fromemployees)9.統(tǒng)計工資小于平均工資的人數(shù)。(子查詢)selectcount(*)fromemployeeswheresalary<(selectavg(salary)fromemployees)10.顯示最高工資人姓名、部門名稱和工作崗位。

selecte.last_name,d.department_name,j.job_titlefromemployeese,departmentsd,jobsjwheresalary=(selectmax(salary)fromemployees)ande.job_id=j.job_idande.department_id=d.department_id11.顯示Smith的工作崗位和該崗位的最高工資和最低工資。(employees,jobs)selecte.last_name,j.job_title,j.min_salary,j.max_salaryfromemployeese,jobsjwheree.last_name='Smith'ande.job_id=j.job_id12.顯示每個部門經(jīng)理的編號及管理的人數(shù)。

selectmanager_id,count(*)fromemployeesgroupbymanager_id13.統(tǒng)計1999年1月1日以后參加工作的人數(shù)。

selectcount(*)fromemployeeswherehire_date>=date‘1999-1-1’或to_date()14.統(tǒng)計1995年到1998年參加工作的人數(shù)。

selectcount(*)fromemployeeswherehire_datebetweento_date('1995-1-1')anddate'1998-12-31'15.顯示Taylor以前工作過的部門名稱、工作崗位、所在城市。顯示格式姓名部門名稱工作崗位城市

selecte.last_name姓名,d.department_name部門名稱,j.job_title工作崗位,c.city城市fromemployeese,departmentsd,jobsj,locationsc,job_historyjjwheree.last_name='Taylor'ande.employee_id=jj.employee_idandd.department_id=jj.department_idandj.job_id=jj.job_idandd.location_id=c.location_id16.按從大到小的順序顯示出所有工資大于9000的姓名、工資。

selectlast_name||‘’||first_name姓名,salary工資

fromemployeeswheresalary>=5000orderbysalarydesc17.統(tǒng)計部門人數(shù)超過5人的部門編號。

selectdepartment_id,count(*)fromemployeesgroupbydepartment_idhavingcount(*)>=518.統(tǒng)計出所有工資大于10000的人數(shù)、平均工資及工資總和。顯示格式:人數(shù)平均數(shù)總數(shù)

selectcount(*),avg(salary),sum(salary)fromemployeeswheresalary>1000019.統(tǒng)計出每個部門的平均工資、工資總和、部門人數(shù)、最大工資和最小工資。

selectdepartment_id,avg(salary),sum(salary),count(*),max(salary),min(salary)fromemployeesgroupbydepartment_id20.統(tǒng)計出每個部門的平均工資、最早參加工作時間和最晚參加工作時間(HIRE_DATE)。selectdepartment_id,max(hire_date),min(hire_date)fromemployeesgrou

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
  • 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論